dirty Posted October 29, 2011 Share Posted October 29, 2011 (edited) How come exact same code works different for XP and W7 ? Simple input code: $SearchByMFG = GUICtrlCreateInput("", 10, 160, 340, 30) GUICtrlSendMsg(-1, $EM_SETCUEBANNER, True, "Manufacture Name by which project is identified") $SearchByMFGButton = GUICtrlCreateButton(" By MFG", 350, 160, 140, 30, $BS_LEFT) GUICtrlSetFont(-1, 12, 400) GUICtrlSetImage(-1, @TempDir & "\search.ico", '', 1) XP ran in a virtual machine produces following result: W7 X64 on which the code was made produces the following: See how not all text is Bold or even misplaced toward left in the Project Details area. Also icons are not drawn on any of the buttons like they do in W7 Is it the virtual machine issue or the code being incapable with XP ? Edited October 29, 2011 by dirty Link to comment Share on other sites More sharing options...
dirty Posted October 29, 2011 Author Share Posted October 29, 2011 Oh never mind, i see. Its the way of how Windows API works with autoit. Seems to vary from one computer to another making it little to less reliable when trying to code something with hopes it would be the same on all machines. Link to comment Share on other sites More sharing options...
martin Posted October 30, 2011 Share Posted October 30, 2011 I doubt it's anything to do with AutoIt; my programss written in Delphi have similar problems. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
dirty Posted October 30, 2011 Author Share Posted October 30, 2011 i said Its the way of how Windows API works with autoit. functions like WinAPI or dllcall i stay away from those because they vary from one computer to another. Link to comment Share on other sites More sharing options...
dirty Posted October 31, 2011 Author Share Posted October 31, 2011 (edited) So after couple of days ago posting this issue, the question is:How to makeGUICtrlSetImage(-1, @TempDir & "\search.ico", "", 1) ;assign icon to buttonto work with XP ? Edited October 31, 2011 by dirty Link to comment Share on other sites More sharing options...
JFX Posted October 31, 2011 Share Posted October 31, 2011 GUICtrlSetImage cause a lot trouble if you want something to show up correctly in different windows versions. try _GUICtrlButton_SetImage instead Link to comment Share on other sites More sharing options...
dirty Posted October 31, 2011 Author Share Posted October 31, 2011 (edited) having _GUICtrlButton_SetImage ($SearchByNameButton,@TempDir & "\search.ico") instead of GUICtrlSetImage($SearchByNameButton, @TempDir & "\search.ico", "", 1) shows no results in XP. Icon is still not drawni even tried_WinAPI_DrawIcon ($SearchByNumberButton,0,0,@TempDir & "\search.ico")but even that dont do anything on both W7 and XP Edited October 31, 2011 by dirty 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