Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - title(string) function not working?
Page 1 of 1

PostPosted: Mon May 19, 2003 6:30 pm
by The_Nerd
I have a problem with my app... two actually. The first one is it seams like the title(string) function doesn't work the way it says it does. Here is the description strait from the doc pages at http://www.pocketc.net/doc/

Description

give your applet a name! So it will appear on the taskbar on the bottom. It will also keep your application single instance. <u><b>When a new PocketC application launchs, it will check if any existing same application running. If it is, it will terminate itself, and switch to the running application.</b></u> It is important feature to have for PPC users.

It doesn't do what I hi-lighted. Look at the shot I took of the two instances.

http://www.decagon.com/~wyatt/iasnap.bmp

What is wrong with this function?

My second problem is that I do not know how to capture the close button event. How do I do this?

Q: What do you call a computer that won't come out of sleep?

A: A WindoZz box.

PostPosted: Tue May 20, 2003 2:08 am
by wolfgang
You are probably using the V3 compiler - I seem to remember that V3 has a bug and the single-instance-feature does not work even when you give your app a title. Another instance (sorry for the pun) where V3 is unusable. It works fine in V2 (I only use V2 anyway).

Second: There is no way to trap the close button event. Your app never gets notified when this button gets pressed, the app simply closes down. Same goes for File -> Exit in the standard menu.

Solution: On older HPC and PPC devices (WindowsCE 2.x) you remove the menu bar (menu_off()) and then draw and handle your own menubar. That's what I do in my programs. You can use Guy's menubar library for that purpose. I did not find a way to trap the close button (the "X") on a PocketPC though, but at least you can remove the standard file menu.

Wolfgang


Composing music on the PocketPC! - http://www.pdamusician.com

PostPosted: Tue May 20, 2003 3:48 am
by The_Nerd
Thanks wolfgang. Is there any limmitations in V2? Also where do I get it.

What you said about the close button just isn't true. The close button on all the PocketC programs I make only minimizes the app, it doesn't close it. That has been my whole problem. I know all about the atexit() function, but it doesn't do any good because the app never actually closes. Thanks for your help and quick response.

Q: What do you call a computer that won't come out of sleep?

A: A WindoZz box.

PostPosted: Fri May 23, 2003 5:20 pm
by KOU
I thought it was able to catch the close message by using guy
's extentions.

KOU

PostPosted: Fri May 23, 2003 6:45 pm
by The_Nerd
I don't know. Is it able to?

Q: What do you call a computer that won't come out of sleep?

A: A WindoZz box.

PostPosted: Fri May 23, 2003 7:56 pm
by KOU
Oops. I didn't think you meant PocketPC 2002 close button.
I don't know about that... Sorry.

(I thought you meant real close like Wisbar close)

KOU

PostPosted: Sat May 24, 2003 4:21 am
by The_Nerd
Np. But it would be REALLY nice if some one knew how... or could tell me that it isn't possible (that wouldn't be as nice though :D)

Q: What do you call a computer that won't come out of sleep?

A: A WindoZz box.

PostPosted: Sat May 24, 2003 3:17 pm
by Mickle
Probably you need to use V3 and CEAPI library.

1. Prevent multiple instances.
Code: Select all
#include "\\PocketC\\winuser.h"
init_app(string sAppTitle)
{
    string sClass;
    HWND   hPrev, hMain;

    GetClassName(hMain = gethwnd(1), sClass, 128);
    if (hPrev = FindWindow(sClass, sAppTitle))
    {
        SetForegroundWindow(hPrev);
// quit() on PocketPC is real QUIT or only minimize ? I not have PocketPC and can't try.
// if quit() only minimize then use DestroyWindow(hMain); instead quit();
        quit();
    }
    title(sAppTitle);
    return hMain;
}

2. Close button event.
I not have PocketPC. I not known what actual make "close" button. Variants:
- hidden window
- minimize but not hidden (IsWindowVisible() will return TRUE)
- change Z-order
Code below should work anyway.
Code: Select all
main()
{
    HWND hMain, hForeground;
    int  bIsVisible = TRUE; // state of main window

    showconsole();
    hMain = init_app("My App");
    while (TRUE)
   {
        sleep(0);
        hForeground = GetForegroundWindow();
        if ((hForeground == hMain || GetParent(hForeground) == hMain) ^ bIsVisible)
        {
            bIsVisible = !bIsVisible;
            if (bIsVisible) putsl("Window was maximized");
            else putsl("Window was minimized");
        }
        switch (event(0)) {
            case PM_COMMAND:
// your event handler...
                break;
        }
    }
}

PostPosted: Tue May 27, 2003 6:08 pm
by The_Nerd
Thanks Mickle. But I don't think that will work and I don't really have the time to try.

Q: What do you call a computer that won't come out of sleep?

A: A WindoZz box.

PostPosted: Tue May 27, 2003 7:55 pm
by Mickle
On HPC/HPC Pro/HPC2000 it work. I don't think that PockePC are completely differ...
Time to try - 30 seconds... (+ time to download PocketC CEAPI library 1 - 5 minutes).

PostPosted: Thu May 29, 2003 8:34 pm
by The_Nerd
Thanks Mickle! I said it probably wouldn't work because I didn't even know there was such a thing as PocketC CEAPI!! SWEETTT!!! Thank you thank you thank you!!! =)

Q: What do you call a computer that won't come out of sleep?

A: A WindoZz box.