AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Autohotkey for Pocket PCs / WinCE
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Micha



Joined: 15 Nov 2005
Posts: 432
Location: Germany

PostPosted: Tue Jan 01, 2008 8:42 pm    Post subject: Autohotkey for Pocket PCs / WinCE Reply with quote

Hi,

My aim is to support a kind of batch files for CE devices (Filecopy, loop, expressions), window automation (Send, Winactivate) and most common gui commands.

Some functions are not working, because there's no API for WindowsCE.
Some functions are requiring system-dlls, which are not present on i.e. PNA so I have commented them out.
Some functions are less important (sound) so I will not implement them, but the code can be changed by everybody else of course.

To associate AHK-Files with AutohotkeyCE.exe, you can use the script from sergeich.
Code:
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, .ahk, , AutoHotkeyScript
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AutoHotkeyScript, , AutoHotkey Script
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AutoHotkeyScript\Shell\Open\Command, , "%A_AhkPath%" "`%1"
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, AutoHotkeyScript\DefaultIcon, , %A_AhkPath%`,`-160


The main problem is the memory (or stack) space. A lot of functions are not working because the stack is corrupt after a function call. These functions have to be rewritten or the allocation must be done with new/delete.

You can download the AutohotkeyCE.exe for ARM processors here V16
You can download the AutohotkeyCE.exe for ARM processors here V17
You can download the AutohotkeyCE.exe for ARM processors here V18
You can download the AutohotkeyCE.exe for ARM processors here V20

The following list will grow in the future

Working:
FileAppend MsgBox
(V3) FileCopy
(v3) Loop
(v3) Expressions (a:=3 / b:= a*4) Gosub Goto
(v4) a_ahkPath a_ahkversion a_workingdir a_scriptdir a_scriptname a_scriptfullpath a_linenumber a_linefile a_thisfunc a_thislabel a_ahkversion a_ahkpath a_exitreason(?) a_YYYY A_MM A_DD a_MMMM a_MMM a_DDDD a_DDD a_Wday a_yday a_yweek a_hour a_min a_sec a_msec a_now a_nowutc a_tickcount A_IsSuspended A_BatchLines A_TitleMatchMode A_TitleMatchModeSpeed A_DetectHiddenWindows A_DetectHiddenText A_AutoTrim A_StringCaseSense A_FormatInteger A_FormatFloat A_KeyDelay A_WinDelay A_ControlDelay A_MouseDelay A_DefaultMouseSpeed A_Temp ~A_OSType ~A_OSVersion A_Language A_ComputerName A_WinDir A_UserName
(v4) functions, Labels Continue
(v5) A_TimeIdle A_TimeIdlePhysical A_ProgramFiles A_Desktop A_StartMenu A_Programs A_Startup A_MyDocuments A_ScreenWidth A_ScreenHeight ExitApp
(v5) abs() FileExist() InStr() SubStr() StrLen() asc() chr() IsLabel() exp() Ceil() Floor() log() ln() mod() round() sqrt() sin() EnvAdd EnvSub is(float int, time...) Arrays FileGetAttrib Autotrim if.between
(v6) Gui: Button, Text, Label, ComboBox; FileSetAttrib FileGetAttrib FileGetTime FileSetTime IfExist IfNotExist StringGetPos SetFormat FileCreateDir FileRemoveDir FormatTime DriveSpaceFree
(v7) RegRead RegWrite FileRead FileReadLine InputBox ErrorLevel Loop(files & folders) Loop(read file contents) Loop(parse a string) Loop(registry)
FileCreateShortcut (only Target and Shortcutfile are supported)
FileGetShortcut (Only OutTarget and OutDir are supported)
ListLines ListVars IfMsgBox SetTimer Sleep Sort
( v8 ) Transform
(v9) Gui, Add
(v10) IfWinExist WinActive WinExist WinActivate MouseClick Process(Exist) Run Send
(v11) ControlGetText ControlGetFocus ControlFocus ControlSetText. Removed OS-dependencies, so AutohotkeyCE is working on PNA or other WinCE "lite" devices. StringGetPos / InStr() StringLeft StringLen / StrLen() StringLower StringMid / SubStr() StringReplace StringRight StringSplit StringTrimLeft StringTrimRight StringUpper
(v12) WinClose WinGetActiveStats WinGetActiveTitle WinGet(ID, IDLast, PID, ProcessName, Count, List, MinMax, ControlList, Style, ExStyle) WinGetClass WinGetPos WinGetText WinGetTitle WinHide WinKill WinSetTitle WinSet(bottom, top, disable, enable, redraw?) WinWait WinWaitActive
(v13) WinMove ControlGetPos WinWaitNotActive WinWaitClose FileCopyDir Process(Close, Wait), After you have registered the ahk-extension (with the 2 lines script above) you can start any ahk-file.
Control: Check Uncheck Enable Disable Show Hide ShowDropDown HideDropDown FileDelete FileMoveDir ControlClick ControlMove SoundPlay SplitPath Random FileRemoveDir FileGetSize FileGetTime FileMove FileGetVersion SetTitleMatchMode CoordMode SetBatchLines StringCaseSense VarSetCapacity
(v14) reload command.
Starting a new instance of a thread kills the current one. This is working now.
(v15) Clipboard functions. This was tricky, because the clipboard is unicode, but the ahk-variables are not. The locked clipboard-buffer is being returned and filled by ahk functions. If you try to write that chars the clipboard isn't able to handle this. The conversion has to be done by hand. /// Listview <-> Gui,Submit: conversion between unicode and char corrected. /// loop, \path\*.*, x, x fixed
(v16) Clipboard functions Part2. When transfering huge strings from/to clipboard, the application crashes (stack overflow), so I had to rewrite these parts of the code
(v17) things like send, {LWin Down}{vkc2sc065}{LWin up} are starting to work. (beta)
(v18) Listview is working with longer texts than 128 bytes
(v19) FileSelectFile
(v20) menu + menu, tray: since (AFAIK) there's no "right mouse click" on a PDA, I'm using just the left click.

not working yet:
-> Autohotkey compiler (currently working on that)
Softwarekeys
Gui: checkbutton Radiobutton
WinSet (AlwaysOnTop)
UrlDownloadToFile
Hotstrings and Auto-replace
GetKeyState WinShow
RegExMatch RegExReplace Traytip SoundBeep FileSelectFolder DriveGet Click KeyWait ListHotkeys
WinMenuSelectItem
WinMaximize WinMinimize WinMinimizeAll WinMinimizeAllUndo WinRestore
After returning from EnumParentFind the stack is corrupt:
WinSet

not supported:
Drive
Winset (Transparent, Transcolor)
a_appdata (?)
a_iscompiled ComSpec A_Language A_AppData A_AppDataCommon A_DesktopCommon A_StartMenuCommon A_ProgramsCommon A_StartupCommon A_IsAdmin A_IPAddress1-4
DllCall RegisterCallback EnvSet FileInstall FileRecycle FileRecycleEmpty RunAs SetWorkingDir
IniDelete IniRead IniWrite : There are very good scripts at the forum to read ini-files very fast with the fileread-command. So there is a good workaround.

To investigate:
WinSet(Style, Region)
Control: Style StyleEx TabLeft Tabright Addstring delete choose choosestring editpaste

ControlGet ControlSend / ControlSendRaw Critical GuiControl GuiControlGet Input MouseClick MouseGetPos MouseMove OutputDebug Pause PixelGetColor PixelSearch PostMessage Process Progress RunWait SendRaw / SendInput / SendPlay SendMessage SendMode SetCapslockState SetControlDelay SetDefaultMouseSpeed SetKeyDelay SetMouseDelay SetNumlockState SetScrollLockState SetStoreCapslockMode SetWinDelay Shutdown StatusBarGetText StatusBarWait Suspend SysGet Thread ToolTip VarSetCapacity()
NumGet NumPut OnMessage BlockInput PixelSearch GroupActivate GroupAdd GroupClose GroupDeactivate MouseClickDrag EnvUpdate ClipWait ImageSearch OnMessage() SoundGet SoundGetWaveVolume SoundSet SoundSetWaveVolume SplashImage SplashTextOn SplashTextOff WinActivateBottom


------------------------------------------
Wishes from the community:
support rotating screens
support "sdi"? windows

Ciao
Micha

--------------
Edit 08-01-01: If autohotkey.ahk does not exist, the user is prompted to create the file (wrong message) and the file is created. At the next run, the created file is used.
Edit 08-01-02: Changed functions to copy results of Macros CW2A back to the original variable.
Edit 08-01-05: Changed about 300 lines of code and testet about 20 functions. (v5-v7) It lasts about 22 hours of work
Edit 08-01-08: Run and some Winxxx functions are working, so some useful scripts can be written.
Edit 08-01-16 I've removed FileSelectFile FileDelete FileRemoveDir FileGetSize FileGetTime FileGetVersion FileMove from the working section. I have disabled them to make AhkCE work on PNAs.


Last edited by Micha on Tue Mar 25, 2008 6:19 pm; edited 166 times in total
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 533

PostPosted: Wed Jan 02, 2008 11:51 pm    Post subject: Reply with quote

wow

this is AwSoMe Shocked
_________________
check out my site
www.eliteknifesquad.com

Back to top
View user's profile Send private message
Rhys



Joined: 17 Apr 2007
Posts: 701
Location: Florida

PostPosted: Thu Jan 03, 2008 1:03 am    Post subject: Reply with quote

Wow, I've been looking for a reason to pull my old Axim out of mothballs. This might be fun to play with.
_________________
[Join IRC!]
Back to top
View user's profile Send private message
halweg



Joined: 27 Jan 2005
Posts: 102
Location: Germany, Dresden

PostPosted: Thu Jan 03, 2008 10:35 am    Post subject: Reply with quote

Micha, you should remark that MSGBOX works!
The most import command for testing and trying.

Btw., how can I start my own scripts? AutohotkeyCE.exe starts the autohotkey.ahk script only Sad

What about GUI-commands? Do we have a chance to get self made clickable bitmaps on the PPC screen?
_________________
Back to top
View user's profile Send private message
Micha



Joined: 15 Nov 2005
Posts: 432
Location: Germany

PostPosted: Thu Jan 03, 2008 12:48 pm    Post subject: Reply with quote

halweg wrote:
Micha, you should remark that MSGBOX works!
Btw., how can I start my own scripts? AutohotkeyCE.exe starts the autohotkey.ahk script only Sad
What about GUI-commands? Do we have a chance to get self made clickable bitmaps on the PPC screen?

Hi halweg,
thank's, I've mentioned MsgBox now.

I'm not sure how you can start a program with command line parameters. Perpaps you have to use "start / run / \temp\autohotkeyCE.exe script2run.ahk ???

The debugger can start autohotkey with a parameter so it must work somehow.
I own only a navigation system (the reason why I'm working on autohotkeyCE) and there autohotkeyce isn't working at all....
I just begun to work with CE devices, so I'm not an expert at all...

Well I fear that gui-commands are much more difficult than all the other stuff.
Just for basic functions (Msgbox, sin, cos...) I had to rewrite a lot of ahk-code. I'm not sure how much time I can spend for that... (je nachdem, wie lange ich Lust dazu habe...)
Ciao
Micha
Back to top
View user's profile Send private message
halweg



Joined: 27 Jan 2005
Posts: 102
Location: Germany, Dresden

PostPosted: Thu Jan 03, 2008 1:18 pm    Post subject: Reply with quote

PPCs have a registry, there you can assign File types with registered programs.
A way to do this (except a registry editor) are programs like resco explorer or sk tools. I'm using resco explorer, so I can do a "open with..." and select either editor (notes.exe) or compiler (autohotkeyce.exe) to open .ahk files.


Micha, please keep on this interesting project. It's a twist of fate that you needed a navigating system. Wink

Have a look at www.ppc-welt.de, there you will find a lot of helping people with knowledge in all details about PPCs.

I'm member of the PPC Club Saxony; if you're interested visit our next meeting (.net Workshop, Dresden, 17.01.2008).
_________________
Back to top
View user's profile Send private message
Micha



Joined: 15 Nov 2005
Posts: 432
Location: Germany

PostPosted: Thu Jan 03, 2008 8:59 pm    Post subject: Reply with quote

Hi,
cool,
easy guis are working:
Back to top
View user's profile Send private message
Micha



Joined: 15 Nov 2005
Posts: 432
Location: Germany

PostPosted: Fri Jan 04, 2008 12:28 pm    Post subject: Reply with quote

Hi, are there any volunteers who could test Gui-commands with (v6) of the autohotkeyCE?
Ciao
Micha
Back to top
View user's profile Send private message
Fry(un logged in)
Guest





PostPosted: Sat Jan 05, 2008 2:57 am    Post subject: Reply with quote

hey,
in your last picture how did you have windows ce on windows xp?


i see a pocket pc on your desktop
Back to top
ahklerner



Joined: 26 Jun 2006
Posts: 1091
Location: USA

PostPosted: Sat Jan 05, 2008 5:20 am    Post subject: Reply with quote

it is called an emulator.
_________________
Back to top
View user's profile Send private message
Micha



Joined: 15 Nov 2005
Posts: 432
Location: Germany

PostPosted: Sat Jan 05, 2008 11:24 am    Post subject: Reply with quote

Hi,
yes it's an emulator. I have to work with just this emulator, because I only own a navigation system and AutohotkeyCE does not run on this device Sad
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 533

PostPosted: Sat Jan 05, 2008 4:15 pm    Post subject: Reply with quote

can you show me where you got it?
_________________
check out my site
www.eliteknifesquad.com

Back to top
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1091
Location: USA

PostPosted: Sat Jan 05, 2008 4:18 pm    Post subject: Reply with quote

Fry wrote:
can you show me where you got it?

Read this post:
http://www.autohotkey.com/forum/viewtopic.php?t=8711
_________________
Back to top
View user's profile Send private message
Fry



Joined: 01 Nov 2007
Posts: 533

PostPosted: Sun Jan 06, 2008 1:02 am    Post subject: Reply with quote

you should take off the (DEMO)

because this has almost all functionality as regular autohotkey
_________________
check out my site
www.eliteknifesquad.com

Back to top
View user's profile Send private message
halweg



Joined: 27 Jan 2005
Posts: 102
Location: Germany, Dresden

PostPosted: Sun Jan 06, 2008 1:32 pm    Post subject: Reply with quote

I tried out this example script:
Code:
Gui, Add, Text,, First name:
Gui, Add, Text,, Last name:
Gui, Add, Edit, vFirstName ym  ; The ym option starts a new column of controls.
Gui, Add, Edit, vLastName
Gui, Add, Button, default, OK  ; The label ButtonOK (if it exists) will be run when the button is pressed.
Gui, Show,, Simple Input Example
return  ; End of auto-execute section. The script is idle until the user does something.

GuiClose:
ButtonOK:
Gui, Submit  ; Save the input from the user to each control's associated variable.
MsgBox You entered "%FirstName% %LastName%".
ExitApp

My PPC shows an oversized white dialog box with two small lines "First name" and ""Last name". No input fields, no posibility to input anything.

When I start AHK a second time one my device, it's not able to automaticly remove the first instanace of autohotkey.exe.
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 1 of 9

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group