kjactive Posted August 1, 2005 Share Posted August 1, 2005 (edited) I has a window I want to change style settings to durring runtime - is this posible and how, there is controls style change support but i could not find any support to make changes to windows other that minimize, maxi etc. I want to change settings from $WS_SIZEBOX,$WS_EX_TOOLWINDOW to _POPUP etc. Is there any help outthere... kjactive Edited August 1, 2005 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 1, 2005 Share Posted August 1, 2005 GUICtrlSetStyle() That should do it if it works. I tried getting that to work with some Combo Boxes, and it didnt. I have yet to submit it as a bug as I am unsure if it really is a bug. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 1, 2005 Share Posted August 1, 2005 ANYGUIv2.1.au3 has _TargetSetStyle()...which should work for any window/control. [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
kjactive Posted August 2, 2005 Author Share Posted August 2, 2005 (edited) GUICtrlSetStyle() don't work on already opened windows only controls, but I tryed the _TargetSetStyle() function but keep getting crashes, what do I do wrong here.... _TargetSetStyle('Replace',$WS_POPUPWINDOW,-1, $MainWin) kjactive Edited August 2, 2005 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 2, 2005 Share Posted August 2, 2005 (edited) try _TargetSetStyle('Add',BitOr(-$WS_SIZEBOX,-$WS_EX_TOOLWINDOW, $WS_POPUPWINDOW),-1, $MainWin) if you use 'replace', you probably are removing default styles that any extended styles depend on. I hesitantly put 'replace' in the function(it's probably more trouble than its worth) Edited August 2, 2005 by quaizywabbit [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 3, 2005 Share Posted August 3, 2005 try _TargetSetStyle('Add',BitOr(-$WS_SIZEBOX,-$WS_EX_TOOLWINDOW, $WS_POPUPWINDOW),-1, $MainWin)if you use 'replace', you probably are removing default styles that any extended styles depend on. I hesitantly put 'replace' in the function(it's probably more trouble than its worth)<{POST_SNAPBACK}>I appreciate your insight. I will have to look into how that will fit into my program.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Valik Posted August 3, 2005 Share Posted August 3, 2005 try _TargetSetStyle('Add',BitOr(-$WS_SIZEBOX,-$WS_EX_TOOLWINDOW, $WS_POPUPWINDOW),-1, $MainWin)if you use 'replace', you probably are removing default styles that any extended styles depend on. I hesitantly put 'replace' in the function(it's probably more trouble than its worth)<{POST_SNAPBACK}>I hope those negative signs are not intentional. That is just asking for disaster if it is. Styles are checked in a bit-wise manner. Setting the high bit (sign bit) most definitely change the styles you are passing.Also, that is a bug, IMO and I will file it as such to see what others think. Link to comment Share on other sites More sharing options...
Valik Posted August 3, 2005 Share Posted August 3, 2005 try _TargetSetStyle('Add',BitOr(-$WS_SIZEBOX,-$WS_EX_TOOLWINDOW, $WS_POPUPWINDOW),-1, $MainWin)if you use 'replace', you probably are removing default styles that any extended styles depend on. I hesitantly put 'replace' in the function(it's probably more trouble than its worth)<{POST_SNAPBACK}>I have to assume that _TargetSetStyle() is not overwriting the style but rather modifying styles. So, it needs rewritten because you just can't do it how you are. To remove a style, the following pseudo code must be done:$style = _GetStyle() $style = BitAND($style, BitNOT($WS_SIZEBOX)); This removes the style $style = BitOR($style, $WS_POPUPWINDOW) _SetStyle($style)Alternatively:$style = _GetStyle() If BitAND($style, $WS_SIZEBOX) Then $style = BitXOR($style, $WS_SIZEBOX); This removes the style $style = BitOR($style, $WS_POPUPWINDOW)And of course, WS_EX_TOOLWINDOW is an extended style so BitORing it into a style is flat out wrong.There must be separate sections of code for adding and removing a style. Adding a style is easy, that's just a BitOR() operation. Removing a style requires un-setting the bits. Inserting a negative sign does not unset bits, in fact, it sets a new bit so what you then end up passing is no longer the original style but something completely different. The only way to unset bits is to use BitAND() and BitNOT() or use BitAND() to check for the correct bit pattern and then use BitXOR() to unset those bits. Also keep in mind that BitXOR() is basically a toggle. If the bits are set, they will be unset; if the bits are not set, they will be set. BitAND(BitNOT()), on the other hand, is like BitOR(); it will only produce one out come. That is, if the bits are set, they will be un-set, otherwise, they will be left un-set. Link to comment Share on other sites More sharing options...
Nutster Posted August 3, 2005 Share Posted August 3, 2005 try _TargetSetStyle('Add',BitOr(-$WS_SIZEBOX,-$WS_EX_TOOLWINDOW, $WS_POPUPWINDOW),-1, $MainWin)if you use 'replace', you probably are removing default styles that any extended styles depend on. I hesitantly put 'replace' in the function(it's probably more trouble than its worth)<{POST_SNAPBACK}>Are you trying to remove a bit-wise feature flag? In that case, instead of -$WS_SIZEBOX, you should use BitNot($WS_SIZEBOX) and then use BitAnd to combine them. Try_TargetSetStyle('Add',BitOr(BitAnd(BitNot($WS_SIZEBOX),BitNot($WS_EX_TOOLWINDOW)), $WS_POPUPWINDOW),-1, $MainWin)BitNot(1) is not the same as -1. David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... Link to comment Share on other sites More sharing options...
kjactive Posted August 3, 2005 Author Share Posted August 3, 2005 Anyhow I get a instant crash - I want to toggle between a popup window and a sizebox window style attached to ESC hotkey without reactivate the gui I can do this in other languages but autoit3 gui let me down 'for the first time' on this one - any suggestions... kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 3, 2005 Share Posted August 3, 2005 @Valik AND @Nutster: THANK YOU BOTH for taking the time to explain how this works!! (Off to fix it now) [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 4, 2005 Share Posted August 4, 2005 (edited) I updated ANYGUI to v2.2 _TargetSetStyle() should work now ( I tested "Remove" on Notepad with a timer, then "Add" to restore Styles.....no errors, worked just fine) by default it doesn't visibly update the window until you set the "Bool" param to 1 so if adding styles/exstyles and also removing, call the function once for each "Action" and set "Bool" to 1 on the last call to update. see below: _TargetSetStyle("Remove", 0, $WS_SIZEBOX, $WS_EX_TOOLWINDOW, $MainWin) _TargetSetStyle("Add", 1, $WS_POPUPWINDOW,-1, $MainWin) should make for better readability too. Edited August 4, 2005 by quaizywabbit [u]Do more with pre-existing apps![/u]ANYGUIv2.8 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