c# - Windows +D disabled but not working -
i have 2 windows form mainform , minimizedmainform. want disable windows+d both forms. parent of both forms 3rd form formbase. have used next code disabling windows+d
private const in gwl_hwndparent =-8 intptr hprog = nativemethods.findwindowex(nativemethods.findwindowex(nativemethods.findwindow("progman", "program manager"), intptr.zero, "shelldll_defview", ""), intptr.zero, "syslistview32", "folderview"); nativemethods.setwindowlong(this.handle, gwl_hwndparent, hprog);
problem facing mainform never getting minimized if press win+d. , first launch of minimizedform if i press win+d doesnt minimized. second+ time load of minimizedmainform if press win+d , form gets minimized. have added above code on formload event of both forms. minimizedmainform opened when click on panel on mainform , vice versa. mainform starting form of project.
what should stop form minimizing on 2nd+ loadform events?
maybe instead of preventing minimizing of window can minimized, have create window can't minimized instead: minimizebox = false
? (it can't simple bet, can't write comments, here comes solution =d)
c# winforms
No comments:
Post a Comment