WINDEV Minimize and System Menu(Close) October 10, 2018 06:29AM |
Registered: 5 years ago Posts: 15 |
Re: WINDEV Minimize and System Menu(Close) October 10, 2018 08:11AM |
Admin Registered: 54 years ago Posts: 280 |
Re: WINDEV Minimize and System Menu(Close) October 10, 2018 01:45PM |
Registered: 5 years ago Posts: 74 |
Re: WINDEV Minimize and System Menu(Close) October 10, 2018 01:56PM |
Registered: 5 years ago Posts: 150 |
//code to hide the window and put in system tray SysIconAdd(fExeDir()+"\Your_Icon.ico",MENU_RightClickMenu,"CT Barcode Import","RestoreWindow") WinStatus(Invisible) create a popup menu "MENU_RightClickMenu" with 1 option "Restore" for the code of the "Restore" option call "RestoreWindow(WM_LBUTTONDBLCLK)" //Code to show the window when the user right clicks on the icon in system tray PROCEDURE RestoreWindow(nOperation is int) // Restores in double click IF nOperation = WM_LBUTTONDBLCLK THEN WinStatus(Active) END
Re: WINDEV Minimize and System Menu(Close) October 10, 2018 03:45PM |
Admin Registered: 5 years ago Posts: 297 |
PROCEDURE TurnOffSystemMenuX ////f16.parsimony.net/forum28986/messages/32491.htm //// -0x1 Disable Maxime //// -0x2 Disable Minimize //// -0x8 Disable the system menu (icon, max & min buttons, etc) //// -040 Disable tittle bar //// -0x4 Disable resize //cpFlags is unsigned int = 0x400 //lpHandleMenu is 8byte int = API("user32", "GetSystemMenu",Handle(),0) //API("user32", "DeleteMenu", lpHandleMenu, 6, cpFlags) //// one removes also the bar of separation ////AppelDLL32("user32", "DeleteMenu", lpHandleMenu, 5, cpFlags) //24/01/13 //this is bjoern's code with alterations LnErrCode is 8byte int = 0 hMenu is system int // Type C :HMENU uPosition is unsigned int = 6 // Type C :UINT uFlags is unsigned int = 0x400 // Type C :UINT hWnd is system int = Handle() // Type C :HWND bRevert is boolean = 0 // Type C :BOOL hMenu = API( "USER32", "GetSystemMenu", hWnd, bRevert ) IF hMenu THEN IF NOT API( "USER32", "DeleteMenu", hMenu, uPosition, uFlags ) THEN LnErrCode = API("KERNEL32","GetLastError") //Trace(errCode) END END //Bjoern's code //PROCEDURE RemoveCloseButton(LOCAL _hwnd is system int) // res is boolean // errCode is 8byte int = 0 // // hMenu is system int // Type C :HMENU // uPosition is unsigned int = 6 // Type C :UINT // uFlags is unsigned int = 0x400 // Type C :UINT // // hWnd is system int = _hwnd // Type C :HWND // bRevert is boolean = 0 // Type C :BOOL // // hMenu = API( "USER32", "GetSystemMenu", hWnd, bRevert ) // IF hMenu THEN // IF NOT API( "USER32", "DeleteMenu", hMenu, uPosition, uFlags ) THEN // errCode = API("KERNEL32","GetLastError") // Trace(errCode) // END // // END
PROCEDURE TurnOnSystemMenuX Masque is 8byte int GWL_STYLE is 8byte int = -16 RDW_FRAME is system int = 1024 RDW_INVALIDATE is system int = 1 RDW_UPDATENOW is system int = 256 WS_MAXIMIZEBOX is system int = 65536 WS_MINIMIZEBOX is system int = 131072 WS_SYSMENU is system int = 524288 Masque = API("user32","GetWindowLongA",Handle(),GWL_STYLE) Masque = BinaryOR(Masque,WS_MINIMIZEBOX) Masque = BinaryOR(Masque,WS_MAXIMIZEBOX) Masque = BinaryOR(Masque,WS_SYSMENU) API("User32","SetWindowLongA",Handle(),GWL_STYLE,Masque) API("User32", "RedrawWindow", Handle(), Null, Null, RDW_FRAME+RDW_INVALIDATE+RDW_UPDATENOW)
Re: WINDEV Minimize and System Menu(Close) October 10, 2018 05:17PM |
Registered: 5 years ago Posts: 15 |