@@ -1775,6 +1775,7 @@ var (
1775
1775
createWindowEx * windows.LazyProc
1776
1776
deferWindowPos * windows.LazyProc
1777
1777
defWindowProc * windows.LazyProc
1778
+ deleteMenu * windows.LazyProc
1778
1779
destroyIcon * windows.LazyProc
1779
1780
destroyMenu * windows.LazyProc
1780
1781
destroyWindow * windows.LazyProc
@@ -1785,6 +1786,7 @@ var (
1785
1786
drawFocusRect * windows.LazyProc
1786
1787
drawTextEx * windows.LazyProc
1787
1788
emptyClipboard * windows.LazyProc
1789
+ enableMenuItem * windows.LazyProc
1788
1790
enableWindow * windows.LazyProc
1789
1791
endDeferWindowPos * windows.LazyProc
1790
1792
endDialog * windows.LazyProc
@@ -1806,12 +1808,17 @@ var (
1806
1808
getForegroundWindow * windows.LazyProc
1807
1809
getIconInfo * windows.LazyProc
1808
1810
getKeyState * windows.LazyProc
1811
+ getMenuCheckMarkDimensions * windows.LazyProc
1809
1812
getMenuInfo * windows.LazyProc
1813
+ getMenuItemCount * windows.LazyProc
1814
+ getMenuItemID * windows.LazyProc
1815
+ getMenuItemInfo * windows.LazyProc
1810
1816
getMessage * windows.LazyProc
1811
1817
getMonitorInfo * windows.LazyProc
1812
1818
getParent * windows.LazyProc
1813
1819
getRawInputData * windows.LazyProc
1814
1820
getScrollInfo * windows.LazyProc
1821
+ getSubMenu * windows.LazyProc
1815
1822
getSysColor * windows.LazyProc
1816
1823
getSysColorBrush * windows.LazyProc
1817
1824
getSystemMenu * windows.LazyProc
@@ -1848,6 +1855,7 @@ var (
1848
1855
peekMessage * windows.LazyProc
1849
1856
postMessage * windows.LazyProc
1850
1857
postQuitMessage * windows.LazyProc
1858
+ redrawWindow * windows.LazyProc
1851
1859
registerClassEx * windows.LazyProc
1852
1860
registerRawInputDevices * windows.LazyProc
1853
1861
registerWindowMessage * windows.LazyProc
@@ -1868,6 +1876,7 @@ var (
1868
1876
setMenu * windows.LazyProc
1869
1877
setMenuDefaultItem * windows.LazyProc
1870
1878
setMenuInfo * windows.LazyProc
1879
+ setMenuItemBitmaps * windows.LazyProc
1871
1880
setMenuItemInfo * windows.LazyProc
1872
1881
setParent * windows.LazyProc
1873
1882
setRect * windows.LazyProc
@@ -1881,6 +1890,7 @@ var (
1881
1890
showWindow * windows.LazyProc
1882
1891
systemParametersInfo * windows.LazyProc
1883
1892
trackMouseEvent * windows.LazyProc
1893
+ trackPopupMenu * windows.LazyProc
1884
1894
trackPopupMenuEx * windows.LazyProc
1885
1895
translateMessage * windows.LazyProc
1886
1896
unhookWinEvent * windows.LazyProc
@@ -1915,6 +1925,7 @@ func init() {
1915
1925
createWindowEx = libuser32 .NewProc ("CreateWindowExW" )
1916
1926
deferWindowPos = libuser32 .NewProc ("DeferWindowPos" )
1917
1927
defWindowProc = libuser32 .NewProc ("DefWindowProcW" )
1928
+ deleteMenu = libuser32 .NewProc ("DeleteMenu" )
1918
1929
destroyIcon = libuser32 .NewProc ("DestroyIcon" )
1919
1930
destroyMenu = libuser32 .NewProc ("DestroyMenu" )
1920
1931
destroyWindow = libuser32 .NewProc ("DestroyWindow" )
@@ -1925,6 +1936,7 @@ func init() {
1925
1936
drawMenuBar = libuser32 .NewProc ("DrawMenuBar" )
1926
1937
drawTextEx = libuser32 .NewProc ("DrawTextExW" )
1927
1938
emptyClipboard = libuser32 .NewProc ("EmptyClipboard" )
1939
+ enableMenuItem = libuser32 .NewProc ("EnableMenuItem" )
1928
1940
enableWindow = libuser32 .NewProc ("EnableWindow" )
1929
1941
endDeferWindowPos = libuser32 .NewProc ("EndDeferWindowPos" )
1930
1942
endDialog = libuser32 .NewProc ("EndDialog" )
@@ -1946,12 +1958,17 @@ func init() {
1946
1958
getForegroundWindow = libuser32 .NewProc ("GetForegroundWindow" )
1947
1959
getIconInfo = libuser32 .NewProc ("GetIconInfo" )
1948
1960
getKeyState = libuser32 .NewProc ("GetKeyState" )
1961
+ getMenuCheckMarkDimensions = libuser32 .NewProc ("GetMenuCheckMarkDimensions" )
1949
1962
getMenuInfo = libuser32 .NewProc ("GetMenuInfo" )
1963
+ getMenuItemCount = libuser32 .NewProc ("GetMenuItemCount" )
1964
+ getMenuItemID = libuser32 .NewProc ("GetMenuItemID" )
1965
+ getMenuItemInfo = libuser32 .NewProc ("GetMenuItemInfoW" )
1950
1966
getMessage = libuser32 .NewProc ("GetMessageW" )
1951
1967
getMonitorInfo = libuser32 .NewProc ("GetMonitorInfoW" )
1952
1968
getParent = libuser32 .NewProc ("GetParent" )
1953
1969
getRawInputData = libuser32 .NewProc ("GetRawInputData" )
1954
1970
getScrollInfo = libuser32 .NewProc ("GetScrollInfo" )
1971
+ getSubMenu = libuser32 .NewProc ("GetSubMenu" )
1955
1972
getSysColor = libuser32 .NewProc ("GetSysColor" )
1956
1973
getSysColorBrush = libuser32 .NewProc ("GetSysColorBrush" )
1957
1974
getSystemMenu = libuser32 .NewProc ("GetSystemMenu" )
@@ -1993,6 +2010,7 @@ func init() {
1993
2010
peekMessage = libuser32 .NewProc ("PeekMessageW" )
1994
2011
postMessage = libuser32 .NewProc ("PostMessageW" )
1995
2012
postQuitMessage = libuser32 .NewProc ("PostQuitMessage" )
2013
+ redrawWindow = libuser32 .NewProc ("RedrawWindow" )
1996
2014
registerClassEx = libuser32 .NewProc ("RegisterClassExW" )
1997
2015
registerRawInputDevices = libuser32 .NewProc ("RegisterRawInputDevices" )
1998
2016
registerWindowMessage = libuser32 .NewProc ("RegisterWindowMessageW" )
@@ -2013,6 +2031,7 @@ func init() {
2013
2031
setMenu = libuser32 .NewProc ("SetMenu" )
2014
2032
setMenuDefaultItem = libuser32 .NewProc ("SetMenuDefaultItem" )
2015
2033
setMenuInfo = libuser32 .NewProc ("SetMenuInfo" )
2034
+ setMenuItemBitmaps = libuser32 .NewProc ("SetMenuItemBitmaps" )
2016
2035
setMenuItemInfo = libuser32 .NewProc ("SetMenuItemInfoW" )
2017
2036
setRect = libuser32 .NewProc ("SetRect" )
2018
2037
setParent = libuser32 .NewProc ("SetParent" )
@@ -2031,6 +2050,7 @@ func init() {
2031
2050
showWindow = libuser32 .NewProc ("ShowWindow" )
2032
2051
systemParametersInfo = libuser32 .NewProc ("SystemParametersInfoW" )
2033
2052
trackMouseEvent = libuser32 .NewProc ("TrackMouseEvent" )
2053
+ trackPopupMenu = libuser32 .NewProc ("TrackPopupMenu" )
2034
2054
trackPopupMenuEx = libuser32 .NewProc ("TrackPopupMenuEx" )
2035
2055
translateMessage = libuser32 .NewProc ("TranslateMessage" )
2036
2056
unhookWinEvent = libuser32 .NewProc ("UnhookWinEvent" )
@@ -2252,6 +2272,15 @@ func DefWindowProc(hWnd HWND, Msg uint32, wParam, lParam uintptr) uintptr {
2252
2272
return ret
2253
2273
}
2254
2274
2275
+ func DeleteMenu (hMenu HMENU , uPosition uint32 , uFlags uint32 ) bool {
2276
+ ret , _ , _ := syscall .Syscall (deleteMenu .Addr (), 3 ,
2277
+ uintptr (hMenu ),
2278
+ uintptr (uPosition ),
2279
+ uintptr (uFlags ))
2280
+
2281
+ return ret != 0
2282
+ }
2283
+
2255
2284
func DestroyIcon (hIcon HICON ) bool {
2256
2285
ret , _ , _ := syscall .Syscall (destroyIcon .Addr (), 1 ,
2257
2286
uintptr (hIcon ),
@@ -2354,6 +2383,15 @@ func EmptyClipboard() bool {
2354
2383
return ret != 0
2355
2384
}
2356
2385
2386
+ func EnableMenuItem (hMenu HMENU , uIDEnableItem uint32 , uEnable uint32 ) bool {
2387
+ ret , _ , _ := syscall .Syscall (enableMenuItem .Addr (), 3 ,
2388
+ uintptr (hMenu ),
2389
+ uintptr (uIDEnableItem ),
2390
+ uintptr (uEnable ))
2391
+
2392
+ return ret != 0
2393
+ }
2394
+
2357
2395
func EnableWindow (hWnd HWND , bEnable bool ) bool {
2358
2396
ret , _ , _ := syscall .Syscall (enableWindow .Addr (), 2 ,
2359
2397
uintptr (hWnd ),
@@ -2552,6 +2590,15 @@ func GetKeyState(nVirtKey int32) int16 {
2552
2590
return int16 (ret )
2553
2591
}
2554
2592
2593
+ func GetMenuCheckMarkDimensions () int32 {
2594
+ ret , _ , _ := syscall .Syscall (getMenuCheckMarkDimensions .Addr (), 0 ,
2595
+ 0 ,
2596
+ 0 ,
2597
+ 0 )
2598
+
2599
+ return int32 (ret )
2600
+ }
2601
+
2555
2602
func GetMenuInfo (hmenu HMENU , lpcmi * MENUINFO ) bool {
2556
2603
ret , _ , _ := syscall .Syscall (getMenuInfo .Addr (), 2 ,
2557
2604
uintptr (hmenu ),
@@ -2561,6 +2608,36 @@ func GetMenuInfo(hmenu HMENU, lpcmi *MENUINFO) bool {
2561
2608
return ret != 0
2562
2609
}
2563
2610
2611
+ func GetMenuItemCount (hMenu HMENU ) int32 {
2612
+ ret , _ , _ := syscall .Syscall (getMenuItemCount .Addr (), 1 ,
2613
+ uintptr (hMenu ),
2614
+ 0 ,
2615
+ 0 )
2616
+
2617
+ return int32 (ret )
2618
+ }
2619
+
2620
+ func GetMenuItemID (hMenu HMENU , nPos int32 ) uint32 {
2621
+ ret , _ , _ := syscall .Syscall (getMenuItemID .Addr (), 2 ,
2622
+ uintptr (hMenu ),
2623
+ uintptr (nPos ),
2624
+ 0 )
2625
+
2626
+ return uint32 (ret )
2627
+ }
2628
+
2629
+ func GetMenuItemInfo (hmenu HMENU , item uint32 , fByPosition BOOL , lpmii * MENUITEMINFO ) bool {
2630
+ ret , _ , _ := syscall .Syscall6 (getMenuItemInfo .Addr (), 4 ,
2631
+ uintptr (hmenu ),
2632
+ uintptr (item ),
2633
+ uintptr (fByPosition ),
2634
+ uintptr (unsafe .Pointer (lpmii )),
2635
+ 0 ,
2636
+ 0 )
2637
+
2638
+ return ret != 0
2639
+ }
2640
+
2564
2641
func GetMessage (msg * MSG , hWnd HWND , msgFilterMin , msgFilterMax uint32 ) BOOL {
2565
2642
ret , _ , _ := syscall .Syscall6 (getMessage .Addr (), 4 ,
2566
2643
uintptr (unsafe .Pointer (msg )),
@@ -2612,6 +2689,15 @@ func GetScrollInfo(hwnd HWND, fnBar int32, lpsi *SCROLLINFO) bool {
2612
2689
return ret != 0
2613
2690
}
2614
2691
2692
+ func GetSubMenu (hMenu HMENU , nPos int32 ) HMENU {
2693
+ ret , _ , _ := syscall .Syscall (getSubMenu .Addr (), 2 ,
2694
+ uintptr (hMenu ),
2695
+ uintptr (nPos ),
2696
+ 0 )
2697
+
2698
+ return HMENU (ret )
2699
+ }
2700
+
2615
2701
func GetSysColor (nIndex int ) uint32 {
2616
2702
ret , _ , _ := syscall .Syscall (getSysColor .Addr (), 1 ,
2617
2703
uintptr (nIndex ),
@@ -2964,6 +3050,38 @@ func PostQuitMessage(exitCode int32) {
2964
3050
0 )
2965
3051
}
2966
3052
3053
+ const (
3054
+ // RedrawWindow() flags
3055
+ RDW_INVALIDATE = 0x0001
3056
+ RDW_INTERNALPAINT = 0x0002
3057
+ RDW_ERASE = 0x0004
3058
+
3059
+ RDW_VALIDATE = 0x0008
3060
+ RDW_NOINTERNALPAINT = 0x0010
3061
+ RDW_NOERASE = 0x0020
3062
+
3063
+ RDW_NOCHILDREN = 0x0040
3064
+ RDW_ALLCHILDREN = 0x0080
3065
+
3066
+ RDW_UPDATENOW = 0x0100
3067
+ RDW_ERASENOW = 0x0200
3068
+
3069
+ RDW_FRAME = 0x0400
3070
+ RDW_NOFRAME = 0x0800
3071
+ )
3072
+
3073
+ func RedrawWindow (hWnd HWND , lprcUpdate * RECT , hrgnUpdate HRGN , flags uint32 ) bool {
3074
+ ret , _ , _ := syscall .Syscall6 (redrawWindow .Addr (), 4 ,
3075
+ uintptr (hWnd ),
3076
+ uintptr (unsafe .Pointer (lprcUpdate )),
3077
+ uintptr (hrgnUpdate ),
3078
+ uintptr (flags ),
3079
+ 0 ,
3080
+ 0 )
3081
+
3082
+ return ret != 0
3083
+ }
3084
+
2967
3085
func RegisterClassEx (windowClass * WNDCLASSEX ) ATOM {
2968
3086
ret , _ , _ := syscall .Syscall (registerClassEx .Addr (), 1 ,
2969
3087
uintptr (unsafe .Pointer (windowClass )),
@@ -3151,6 +3269,18 @@ func SetMenuInfo(hmenu HMENU, lpcmi *MENUINFO) bool {
3151
3269
return ret != 0
3152
3270
}
3153
3271
3272
+ func SetMenuItemBitmaps (hMenu HMENU , uPosition uint32 , uFlags uint32 , hBitmapUnchecked HBITMAP , hBitmapChecked HBITMAP ) bool {
3273
+ ret , _ , _ := syscall .Syscall6 (setMenuItemBitmaps .Addr (), 5 ,
3274
+ uintptr (hMenu ),
3275
+ uintptr (uPosition ),
3276
+ uintptr (uFlags ),
3277
+ uintptr (hBitmapUnchecked ),
3278
+ uintptr (hBitmapChecked ),
3279
+ 0 )
3280
+
3281
+ return ret != 0
3282
+ }
3283
+
3154
3284
func SetMenuItemInfo (hMenu HMENU , uItem uint32 , fByPosition bool , lpmii * MENUITEMINFO ) bool {
3155
3285
ret , _ , _ := syscall .Syscall6 (setMenuItemInfo .Addr (), 4 ,
3156
3286
uintptr (hMenu ),
@@ -3300,6 +3430,21 @@ func TrackMouseEvent(lpEventTrack *TRACKMOUSEEVENT) bool {
3300
3430
return ret != 0
3301
3431
}
3302
3432
3433
+ func TrackPopupMenu (hMenu HMENU , uFlags uint32 , x , y int32 , nReserved int32 , hWnd HWND , prcRect * RECT ) uint32 {
3434
+ ret , _ , _ := syscall .Syscall9 (trackPopupMenu .Addr (), 7 ,
3435
+ uintptr (hMenu ),
3436
+ uintptr (uFlags ),
3437
+ uintptr (x ),
3438
+ uintptr (y ),
3439
+ uintptr (nReserved ),
3440
+ uintptr (hWnd ),
3441
+ uintptr (unsafe .Pointer (prcRect )),
3442
+ 0 ,
3443
+ 0 )
3444
+
3445
+ return uint32 (ret )
3446
+ }
3447
+
3303
3448
func TrackPopupMenuEx (hMenu HMENU , fuFlags uint32 , x , y int32 , hWnd HWND , lptpm * TPMPARAMS ) BOOL {
3304
3449
ret , _ , _ := syscall .Syscall6 (trackPopupMenuEx .Addr (), 6 ,
3305
3450
uintptr (hMenu ),
0 commit comments