Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips > Additional Libraries
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.


Useful Library


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-08-2007, 12:47 PM
dzt's Avatar
dzt dzt is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: Greece
Posts: 353
Awards Showcase
Forum Contributer 
Total Awards: 1
Default Useful Library

Hello,

Attached is dzHW.zip file which contains dzHW.dll library I made (and dzHWdesktop.dll) and a b4ppc sample of how to use it.

Implements dzHW class with the following methods.

SoftReset: Soft resets the device
MessageBeep(wType): Beep! wTypw determines the type of sound and should be one of MsgBox icons (see B4PPC help, topic "MsgBox Constants")
GetTickCount: A high resolution timing method. Returns time elapsed in miliseconds since the computer/device is booted.
GetACLineStatus: Returns 1 if on AC power, 0 if not.
GetBatteryLifePercent: Returns percentage of Battery Life remaining.
InputPanel: Returns or Sets Soft Input Panel (SIP) state. 1 if it's active, 0 if not. Setting InputPanel = true, activates it and InputPanel = false deactivates it.

The desktop version has limited functionality. Implements only MessageBeep, GetTickCount, GetACLineStatus and GetBatteryLifePercent and not tested at all. Other function are dummy.
Attached Files
File Type: zip dzHW.ZIP (114.5 KB, 295 views)
__________________
Dimitris Zacharakis
http://www.terracom.gr
Reply With Quote
  #2 (permalink)  
Old 06-08-2007, 01:06 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,651
Default

Some of these functions will be implemented in the Hardware library in the future.
Reply With Quote
  #3 (permalink)  
Old 06-08-2007, 02:53 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,030
Default

Awsome job dzt...

I wish i could undertand the dll creation structure..
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD
Reply With Quote
  #4 (permalink)  
Old 06-08-2007, 03:11 PM
Junior Member
 
Join Date: May 2007
Posts: 37
Default

Wowwwwwwww..... feel like got a christmas gift! Finally i can get my SIP status... Thank you so MUCH dzt!
Reply With Quote
  #5 (permalink)  
Old 06-11-2007, 07:16 PM
JJM JJM is offline
Knows the basics
 
Join Date: Apr 2007
Location: France
Posts: 71
Default

Thanks so much,Dzt, for your library. It's very useful.

Bye et best regards

JJM
Reply With Quote
  #6 (permalink)  
Old 06-12-2007, 02:18 AM
Knows the basics
 
Join Date: May 2007
Posts: 82
Default

Woah, it's great! Thank you Dzt
Reply With Quote
  #7 (permalink)  
Old 06-12-2007, 12:38 PM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 422
Default

Hello Dimitris,
You did great on this DLL, indeed. Compliments!
Quick question please, dzHW.dll creates a number of objects in Tools/Add Object, such as MyComputer, MyApplication, MyProject, etc.
Please forgive my curiosity, what are these for?

Thanks to your DLL, I put together a precise Delay routine with DoEvents

Sub Delay (ms)
elapse = 0
begin = dz.GetTickCount
do While (elapse < ms)
DoEvents
elapse = dz.GetTickCount - begin
Loop
End Sub
Reply With Quote
  #8 (permalink)  
Old 06-16-2007, 10:33 PM
dzt's Avatar
dzt dzt is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: Greece
Posts: 353
Awards Showcase
Forum Contributer 
Total Awards: 1
Default New version of dzHW.dll

Hi,

Thank you all for your good words.

alfcen, objects My????? are useless objects created by default, which I forgot to remove in desktop version.

I added 4 new functions:

BringWindowToFront("WindowName"): If Window with Title WindowName is Acive becomes the front window.

BringWindowToFrontC("ClassName"): If Window with Class name ClassName is Acive becomes the front window.

PostMessageToWindow("WindowName", wMsg, wParam, lParam): Sends Message wMsg with parameters wParam and lParam to Window with Title WindowName. Does not wait for the Window to process the message.

PostMessageToWindowC("ClassName", wMsg, wParam, lParam): Sends Message wMsg with parameters wParam and lParam to Window with class name ClassName. Does not wait for the Window to process the message.

For wMsg, wParam, lParam values search the web for winuser.h
One of many google results is: http://doc.ddart.net/msdn/header/include/winuser.h.html

For how to use new functions look at sample test2.sbp included in zip file.

Best Regards
Attached Files
File Type: zip dzHW-2.zip (6.9 KB, 142 views)
__________________
Dimitris Zacharakis
http://www.terracom.gr

Last edited by dzt : 06-18-2007 at 10:57 PM. Reason: Bug fix. Attached again dzHW-2.ZIP with fixed dzHW.dll
Reply With Quote
  #9 (permalink)  
Old 06-17-2007, 04:20 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 422
Default

Hello Dimitris
Thanks a lot for your fast action. All side effects except for SPS are gone.
Visual Studio is an unaffordable suite for me (and probably for many other forum members as well). Please keep the DLL(s) coming.

Cheers
Robert
Reply With Quote
  #10 (permalink)  
Old 06-17-2007, 07:57 AM
Knows the basics
 
Join Date: May 2007
Posts: 82
Default

Thank you Dimitris. Did you think about SMS library ?
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Door library (Beta) - Special library Erel Official Updates 48 07-18-2008 02:33 PM
Merging Outlook library and Phone library Erel Official Updates 2 07-14-2008 03:38 PM


All times are GMT. The time now is 05:47 PM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0