@@ -284,47 +284,47 @@ func init() {
284
284
loadIconWithScaleDown = libcomctl32 .NewProc ("LoadIconWithScaleDown" )
285
285
}
286
286
287
- func ImageList_Add (himl HIMAGELIST , hbmImage , hbmMask HBITMAP ) int32 {
288
- ret , _ , _ := syscall .Syscall (imageList_Add .Addr (), 3 ,
287
+ func ImageList_Add (himl HIMAGELIST , hbmImage , hbmMask HBITMAP ) ( int32 , syscall. Errno ) {
288
+ ret , _ , err := syscall .Syscall (imageList_Add .Addr (), 3 ,
289
289
uintptr (himl ),
290
290
uintptr (hbmImage ),
291
291
uintptr (hbmMask ))
292
292
293
- return int32 (ret )
293
+ return int32 (ret ), err
294
294
}
295
295
296
- func ImageList_AddMasked (himl HIMAGELIST , hbmImage HBITMAP , crMask COLORREF ) int32 {
297
- ret , _ , _ := syscall .Syscall (imageList_AddMasked .Addr (), 3 ,
296
+ func ImageList_AddMasked (himl HIMAGELIST , hbmImage HBITMAP , crMask COLORREF ) ( int32 , syscall. Errno ) {
297
+ ret , _ , err := syscall .Syscall (imageList_AddMasked .Addr (), 3 ,
298
298
uintptr (himl ),
299
299
uintptr (hbmImage ),
300
300
uintptr (crMask ))
301
301
302
- return int32 (ret )
302
+ return int32 (ret ), err
303
303
}
304
304
305
- func ImageList_Create (cx , cy int32 , flags uint32 , cInitial , cGrow int32 ) HIMAGELIST {
306
- ret , _ , _ := syscall .Syscall6 (imageList_Create .Addr (), 5 ,
305
+ func ImageList_Create (cx , cy int32 , flags uint32 , cInitial , cGrow int32 ) ( HIMAGELIST , syscall. Errno ) {
306
+ ret , _ , err := syscall .Syscall6 (imageList_Create .Addr (), 5 ,
307
307
uintptr (cx ),
308
308
uintptr (cy ),
309
309
uintptr (flags ),
310
310
uintptr (cInitial ),
311
311
uintptr (cGrow ),
312
312
0 )
313
313
314
- return HIMAGELIST (ret )
314
+ return HIMAGELIST (ret ), err
315
315
}
316
316
317
- func ImageList_Destroy (hIml HIMAGELIST ) bool {
318
- ret , _ , _ := syscall .Syscall (imageList_Destroy .Addr (), 1 ,
317
+ func ImageList_Destroy (hIml HIMAGELIST ) ( bool , syscall. Errno ) {
318
+ ret , _ , err := syscall .Syscall (imageList_Destroy .Addr (), 1 ,
319
319
uintptr (hIml ),
320
320
0 ,
321
321
0 )
322
322
323
- return ret != 0
323
+ return ret != 0 , err
324
324
}
325
325
326
- func ImageList_DrawEx (himl HIMAGELIST , i int32 , hdcDst HDC , x , y , dx , dy int32 , rgbBk COLORREF , rgbFg COLORREF , fStyle uint32 ) bool {
327
- ret , _ , _ := syscall .Syscall12 (imageList_DrawEx .Addr (), 10 ,
326
+ func ImageList_DrawEx (himl HIMAGELIST , i int32 , hdcDst HDC , x , y , dx , dy int32 , rgbBk COLORREF , rgbFg COLORREF , fStyle uint32 ) ( bool , syscall. Errno ) {
327
+ ret , _ , err := syscall .Syscall12 (imageList_DrawEx .Addr (), 10 ,
328
328
uintptr (himl ),
329
329
uintptr (i ),
330
330
uintptr (hdcDst ),
@@ -338,53 +338,53 @@ func ImageList_DrawEx(himl HIMAGELIST, i int32, hdcDst HDC, x, y, dx, dy int32,
338
338
0 ,
339
339
0 )
340
340
341
- return ret != 0
341
+ return ret != 0 , err
342
342
}
343
343
344
- func ImageList_ReplaceIcon (himl HIMAGELIST , i int32 , hicon HICON ) int32 {
345
- ret , _ , _ := syscall .Syscall (imageList_ReplaceIcon .Addr (), 3 ,
344
+ func ImageList_ReplaceIcon (himl HIMAGELIST , i int32 , hicon HICON ) ( int32 , syscall. Errno ) {
345
+ ret , _ , err := syscall .Syscall (imageList_ReplaceIcon .Addr (), 3 ,
346
346
uintptr (himl ),
347
347
uintptr (i ),
348
348
uintptr (hicon ))
349
349
350
- return int32 (ret )
350
+ return int32 (ret ), err
351
351
}
352
352
353
- func InitCommonControlsEx (lpInitCtrls * INITCOMMONCONTROLSEX ) bool {
354
- ret , _ , _ := syscall .Syscall (initCommonControlsEx .Addr (), 1 ,
353
+ func InitCommonControlsEx (lpInitCtrls * INITCOMMONCONTROLSEX ) ( bool , syscall. Errno ) {
354
+ ret , _ , err := syscall .Syscall (initCommonControlsEx .Addr (), 1 ,
355
355
uintptr (unsafe .Pointer (lpInitCtrls )),
356
356
0 ,
357
357
0 )
358
358
359
- return ret != 0
359
+ return ret != 0 , err
360
360
}
361
361
362
- func LoadIconMetric (hInstance HINSTANCE , lpIconName * uint16 , lims int32 , hicon * HICON ) HRESULT {
362
+ func LoadIconMetric (hInstance HINSTANCE , lpIconName * uint16 , lims int32 , hicon * HICON ) ( HRESULT , syscall. Errno ) {
363
363
if loadIconMetric .Find () != nil {
364
- return HRESULT (0 )
364
+ return HRESULT (0 ), syscall . ERROR_PROC_NOT_FOUND
365
365
}
366
- ret , _ , _ := syscall .Syscall6 (loadIconMetric .Addr (), 4 ,
366
+ ret , _ , err := syscall .Syscall6 (loadIconMetric .Addr (), 4 ,
367
367
uintptr (hInstance ),
368
368
uintptr (unsafe .Pointer (lpIconName )),
369
369
uintptr (lims ),
370
370
uintptr (unsafe .Pointer (hicon )),
371
371
0 ,
372
372
0 )
373
373
374
- return HRESULT (ret )
374
+ return HRESULT (ret ), err
375
375
}
376
376
377
- func LoadIconWithScaleDown (hInstance HINSTANCE , lpIconName * uint16 , w int32 , h int32 , hicon * HICON ) HRESULT {
377
+ func LoadIconWithScaleDown (hInstance HINSTANCE , lpIconName * uint16 , w int32 , h int32 , hicon * HICON ) ( HRESULT , syscall. Errno ) {
378
378
if loadIconWithScaleDown .Find () != nil {
379
- return HRESULT (0 )
379
+ return HRESULT (0 ), syscall . ERROR_PROC_NOT_FOUND
380
380
}
381
- ret , _ , _ := syscall .Syscall6 (loadIconWithScaleDown .Addr (), 5 ,
381
+ ret , _ , err := syscall .Syscall6 (loadIconWithScaleDown .Addr (), 5 ,
382
382
uintptr (hInstance ),
383
383
uintptr (unsafe .Pointer (lpIconName )),
384
384
uintptr (w ),
385
385
uintptr (h ),
386
386
uintptr (unsafe .Pointer (hicon )),
387
387
0 )
388
388
389
- return HRESULT (ret )
389
+ return HRESULT (ret ), err
390
390
}
0 commit comments