dantay9 Posted May 23, 2009 Share Posted May 23, 2009 (edited) I would like to know how to make all windows have a limited size so I can add a bar on the side of the window. I want it to look like a widget bar, but that isn't what it is for. I know this can be done, probably with multiple dll calls, I just don't know how. I want extra space on the edge of the desktop even when windows are maximized. Edited May 26, 2009 by dantay9 Link to comment Share on other sites More sharing options...
Authenticity Posted May 23, 2009 Share Posted May 23, 2009 http://msdn.microsoft.com/en-us/library/ms...28VS.85%29.aspxYou're looking for SPI_SETWORKAREA. Link to comment Share on other sites More sharing options...
dantay9 Posted May 23, 2009 Author Share Posted May 23, 2009 I tried that out, but I don't think I am doing it right. Here's what I got: Global Const $SPIF_SENDCHANGE = 0x0002 $Structure = DllStructCreate("int var1; int var2; int var3; long var4") DllStructSetData($Structure, "var1", 0) DllStructSetData($Structure, "var2", 0) DllStructSetData($Structure, "var3", 500) DllStructSetData($Structure, "var4", 500) DllCall("user32.dll", "int", "SystemParametersInfo", "uint", "SPI_SETWORKAREA", "uint", 0, "ptr", $Structure, "uint", $SPIF_SENDCHANGE) Link to comment Share on other sites More sharing options...
Authenticity Posted May 23, 2009 Share Posted May 23, 2009 It's a constant not a string. #define SPI_SETWORKAREA 0x002F Link to comment Share on other sites More sharing options...
dantay9 Posted May 23, 2009 Author Share Posted May 23, 2009 (edited) It doesn't work. When I maximize windows, they still cover the whole screen. Am I still doing something wrong? Global Const $SPIF_SENDCHANGE = 0x0002 $Structure = DllStructCreate("int var1; int var2; int var3; long var4") DllStructSetData($Structure, "var1", 0) DllStructSetData($Structure, "var2", 0) DllStructSetData($Structure, "var3", 500) DllStructSetData($Structure, "var4", 500) MsgBox(0, '', DllCall("user32.dll", "int", "SystemParametersInfo", "uint", 0x002F, "uint", 0, "ptr", $Structure, "uint", $SPIF_SENDCHANGE)) Edited May 23, 2009 by dantay9 Link to comment Share on other sites More sharing options...
Yashied Posted May 23, 2009 Share Posted May 23, 2009 It doesn't work. When I maximize windows, they still cover the whole screen. Am I still doing something wrong? Global Const $SPIF_SENDCHANGE = 0x0002 $Structure = DllStructCreate("int var1; int var2; int var3; long var4") DllStructSetData($Structure, "var1", 0) DllStructSetData($Structure, "var2", 0) DllStructSetData($Structure, "var3", 500) DllStructSetData($Structure, "var4", 500) MsgBox(0, '', DllCall("user32.dll", "int", "SystemParametersInfo", "uint", 0x002F, "uint", 0, "ptr", $Structure, "uint", $SPIF_SENDCHANGE))DllCall("user32.dll", "int", "SystemParametersInfo", "uint", 0x002F, "uint", 0, "ptr", DllStructGetPtr($Structure), "uint", $SPIF_SENDCHANGE) My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Authenticity Posted May 23, 2009 Share Posted May 23, 2009 DllCall("user32.dll", "int", "SystemParametersInfo", "uint", 0x002F, "uint", 0, "ptr", DllStructGetPtr($Structure), "uint", $SPIF_SENDCHANGE) ...and MsgBox will return always 0 because that it what it shows when you pass in an array type variable. Link to comment Share on other sites More sharing options...
dantay9 Posted May 23, 2009 Author Share Posted May 23, 2009 (edited) Thank you for your help and patience. The limits work when the window is maximized, but when the window isn't maximized, it can still go into the area for the "widget bar". How can I fix that? Global Const $SPIF_SENDCHANGE = 0x0002 $Structure = DllStructCreate("int var1; int var2; int var3; int var4") DllStructSetData($Structure, "var1", 0) DllStructSetData($Structure, "var2", 0) DllStructSetData($Structure, "var3", @DesktopWidth / 2) DllStructSetData($Structure, "var4", @DesktopHeight) DllCall("user32.dll", "int", "SystemParametersInfo", "uint", 0x002F, "uint", 0, "ptr", DllStructGetPtr($Structure), "uint", $SPIF_SENDCHANGE) Edited May 23, 2009 by dantay9 Link to comment Share on other sites More sharing options...
Authenticity Posted May 23, 2009 Share Posted May 23, 2009 Heh, that is the annoying thing. If your window has always on top such as the taskbar window then if another window has also $WM_EX_TOPMOST extended style it'll go over top of yours, and the top of the taskbar window for that matter. In my opinion you can make your window top most but if another window is willing to go top over your window you should allow it and not play annoying WinMove tricks :}. Link to comment Share on other sites More sharing options...
dantay9 Posted May 24, 2009 Author Share Posted May 24, 2009 I found exactly what I want, but I don't understand all the dll calls and the functions. It makes a widget bar and allows widgets to be added. All I want is the widget bar. I need help understanding the code. If someone could cut out the code that makes the widget bar and explain to me what each of the dll calls and functions are doing, that would be great! Here's the link:http://www.autoitscript.com/forum/index.ph...rank%27s+gadget Link to comment Share on other sites More sharing options...
Yashied Posted May 24, 2009 Share Posted May 24, 2009 I found exactly what I want, but I don't understand all the dll calls and the functions. It makes a widget bar and allows widgets to be added. All I want is the widget bar. I need help understanding the code. If someone could cut out the code that makes the widget bar and explain to me what each of the dll calls and functions are doing, that would be great! Here's the link:http://www.autoitscript.com/forum/index.ph...rank%27s+gadgetWhy do not you ask the author? My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
dantay9 Posted May 24, 2009 Author Share Posted May 24, 2009 I just figured I would post it on the forum so I could get everyone's opinions and ideas. Do you know how the widget bar is formed? Link to comment Share on other sites More sharing options...
picea892 Posted May 24, 2009 Share Posted May 24, 2009 Hi I was wondering if someone could provide a demonstration or tell me how to use the SPI_GETWORKAREA to get the work space dimensions. Sorry if this is considered hijacking a thread but the topic is same, just in reverse. Link to comment Share on other sites More sharing options...
Authenticity Posted May 24, 2009 Share Posted May 24, 2009 #include <WinAPI.au3> Global Const $SPI_GETWORKAREA = 0x0030 Global $tRECT, $pRECT Global $aRet $tRECT = DllStructCreate($tagRECT) $pRECT = DllStructGetPtr($tRECT) $aRet = DllCall('user32.dll', 'int', 'SystemParametersInfo', 'uint', $SPI_GETWORKAREA, 'uint', 0, _ 'ptr', $pRECT, 'uint', 0) If Not @error And $aRet[0] Then ConsoleWrite(StringFormat("Width: %d\tHeight: %d\n", DllStructGetData($tRECT, 'Right'), _ DllStructGetData($tRECT, 'Bottom'))) Else ConsoleWrite(_WinAPI_GetLastErrorMessage()) EndIf Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now