Hawkwing Posted March 28, 2009 Share Posted March 28, 2009 From what I can see, this code should constantly display the tooltip 1 beneath the cursor. It works when the background is set to Bliss, but when I change it to anything else, the code doesn't do anything. While 1 If Not RegRead ("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper") = "C:\WINDOWS\Web\Wallpaper\Bliss.bmp" Then ;I assume that this is the part that doesn't work for some reason ToolTip ("1") EndIf If RegRead ("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper") = "C:\WINDOWS\Web\Wallpaper\Bliss.bmp" Then ToolTip ("1") EndIf WEnd The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. Link to comment Share on other sites More sharing options...
Yashied Posted March 28, 2009 Share Posted March 28, 2009 if not 1 = 1 then - This is wrong.if not (1 = 1) then 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...
AdmiralAlkex Posted March 28, 2009 Share Posted March 28, 2009 It should be like this: While 1 If RegRead ("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper") <> "C:\WINDOWS\Web\Wallpaper\Bliss.bmp" Then;I assume that this is the part that doesn't work for some reason ToolTip ("1") EndIf If RegRead ("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper") = "C:\WINDOWS\Web\Wallpaper\Bliss.bmp" Then ToolTip ("2") EndIf WEnd .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Hawkwing Posted March 28, 2009 Author Share Posted March 28, 2009 I see. So instead of using "If Not" I just have to replace the = with <>. Thanks. The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. Link to comment Share on other sites More sharing options...
TerarinK Posted March 28, 2009 Share Posted March 28, 2009 You can also keep in the same way just enclose it by () While 1 If Not (RegRead ("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper") = "C:\WINDOWS\Web\Wallpaper\Bliss.bmp") Then ;I assume that this is the part that doesn't work for some reason ToolTip ("1") EndIf If RegRead ("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper") = "C:\WINDOWS\Web\Wallpaper\Bliss.bmp" Then ToolTip ("1") EndIf WEnd 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E Link to comment Share on other sites More sharing options...
TerarinK Posted March 28, 2009 Share Posted March 28, 2009 Why not just use this? While 1 If RegRead("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper") = "C:\WINDOWS\Web\Wallpaper\Bliss.bmp" Then ToolTip(1) Else ToolTip(0) EndIf WEnd The thing was the way you said it was Not RegRead ("HKEY_CURRENT_USER\Control Panel\Desktop", "Wallpaper") which will equal 1 if true else false then you are doing the = and with 1|0 doesn't equal a "C:\WINDOWS\Web\Wallpaper\Bliss.bmp". I just changed the way it was being said with NOT and enclosed in braces the comparision of two strings if they equal 1 then the finished product will be 0, if is 0 then 1 will be shown. 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E Link to comment Share on other sites More sharing options...
TerarinK Posted March 28, 2009 Share Posted March 28, 2009 Also look at the order of operation under the help.From highest precedence to lowest: NOT ^ * / + - & < > <= >= = <> == AND OR The only thing that counter it would be that of ()You can use brackets to force a part of the expression to be evaluated first.e.g. (2 + 4) * 10 equals 60. 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E Link to comment Share on other sites More sharing options...
Hawkwing Posted March 28, 2009 Author Share Posted March 28, 2009 I was editing a script that changed the background. I was trying to make a loop that would change the background between $x different .bmp files. I used the If Not and didn't know that I had to put brackets around the RegRead. This script was just a simple test to locate exactly where the problem was happening. The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. 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