-- Flystone sorting
First define the API
- Function Integer globaladdatom (ref string lpstring) Library "kernel32.dll" alias for "globaladdatoma"
- Function ulong registerhotkey (ulong hwnd, ulong ID, ulong fsmodifiers, ulong VK) Library "user32.dll"
Define variables:
- Constant integer mod_alt = 1
- Constant integer mod_control = 2
- Constant integer mod_shift = 4
- Int atomid [11] // used to place the hotkey ID
Register the hotkey, for example, in the opem event:
- Long ll_rc
- String ls_str [11]
- Ls_str [1] = "My atom id0"
- Atomid [1] = globaladdatom (ls_str [1]) // obtain a unique ID to avoid conflict with other applications.
- Ll_rc = registerhotkey (handle (this), atomid [1], 0, 48) // 0
- Ls_str [2] = "My atom id1"
- Atomid [2] = globaladdatom (ls_str [2]) // obtain the unique ID
- Ll_rc = ll_rc + registerhotkey (handle (this), atomid [2], 0, 49) // 1
- Ls_str [3] = "My atom Id2"
- Atomid [3] = globaladdatom (ls_str [3]) // obtain the unique ID
- Ll_rc = ll_rc + registerhotkey (handle (this), atomid [3], 0, 50) // 2
- Ls_str [4] = "My atom ID3"
- Atomid [4] = globaladdatom (ls_str [4]) // obtain the unique ID
- Ll_rc = ll_rc + registerhotkey (handle (this), atomid [4], 0, 51) // 3
- Ls_str [5] = "My atom ID4"
- Atomid [5] = globaladdatom (ls_str [5]) // obtain the unique ID
- Ll_rc = ll_rc + registerhotkey (handle (this), atomid [5], 0, 52) // 4
- Ls_str [6] = "My atom id5"
- Atomid [6] = globaladdatom (ls_str [6]) // obtain the unique ID
- Ll_rc = ll_rc + registerhotkey (handle (this), atomid [6], 0, 53) // 5
- Ls_str [7] = "My atom id6"
- Atomid [7] = globaladdatom (ls_str [7]) // obtain the unique ID
- Ll_rc = ll_rc + registerhotkey (handle (this), atomid [7], 0, 54) // 6
- Ls_str [8] = "My atom id7"
- Atomid [8] = globaladdatom (ls_str [8]) // obtain the unique ID
- Ll_rc = ll_rc + registerhotkey (handle (this), atomid [8], 0, 55) // 7
- Ls_str [9] = "My atom id8"
- Atomid [9] = globaladdatom (ls_str [9]) // obtain the unique ID
- Ll_rc = ll_rc + registerhotkey (handle (this), atomid [9], 0, 56) // 8
- Ls_str [10] = "My atom id9"
- Atomid [10] = globaladdatom (ls_str [10]) // obtain the unique ID
- Ll_rc = ll_rc + registerhotkey (handle (this), atomid [10], 0, 57) // 9
- Ls_str [11] = "My atom idx"
- If ll_rc <10 then // modify it here
- MessageBox ("error", "error message ")
- End if
Respond to othwe events:
- If wparam = atomid [1]... then
- // MessageBox ('', 'asdf ')
- // Your script
- End if