odaylton Posted November 8, 2018 Share Posted November 8, 2018 When we use: GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") We create functions for the events, ok In several examples used we have several ways of doing the same thing and would like to know the differences in performace question or if there is a real reason to use each one of them: ;Case 1 $hWndFrom = $lParam $iIDFrom = BitAND($wParam, 0xFFFF) ; Low Word $iCode = BitShift($wParam, 16) ; Hi Word ;or ;Case2 $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") ;or ;Case 3 $iIDFrom = _WinAPI_LoWord ($iwParam) $iCode = _WinAPI_HiWord ($iwParam) in my opinion Case 1 would be the fastest and most efficient way, if someone can show the advantages and disadvantages of each of them please ... and possible errors in 32 or 64 bits Link to comment Share on other sites More sharing options...
TheDcoder Posted November 9, 2018 Share Posted November 9, 2018 Hello @odaylton, while I am not qualified to speak about the specifics about window GUI messages, I can offer you some general advice: Case 1: It would be most efficient as you are using AutoIt's native Bit operation functions Case 2: This would actually be more relevant since the NHMDR tag (structure) is designed to contain information about a message, but how efficient or safe it is depends on how the struct is populated... Case 3: I think this would be your safest option if you want to get the Hi and Low words, as it is a direct call to the Windows API Take my advice with a pinch of salt Xandy and FrancescoDiMuro 2 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
odaylton Posted December 5, 2018 Author Share Posted December 5, 2018 On 09/11/2018 at 2:33 AM, TheDcoder said: Hello @odaylton, while I am not qualified to speak about the specifics about window GUI messages, I can offer you some general advice: Case 1: It would be most efficient as you are using AutoIt's native Bit operation functions Case 2: This would actually be more relevant since the NHMDR tag (structure) is designed to contain information about a message, but how efficient or safe it is depends on how the struct is populated... Case 3: I think this would be your safest option if you want to get the Hi and Low words, as it is a direct call to the Windows API Take my advice with a pinch of salt thanks for the info and I think these details should be more standardized in the help files. 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