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?

title(string) function not working?

Discuss topics that apply across the products, such as the PocketC language, or development in general

Postby The_Nerd on Mon May 19, 2003 6:30 pm

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.
Q: What do you call a computer that won't come out of sleep?

A: A WindoZz box.
The_Nerd
 
Posts: 10
Joined: Mon Jan 06, 2003 8:55 pm
Location: USA

Postby wolfgang on Tue May 20, 2003 2:08 am

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
Composing music on the PocketPC! - http://www.pdamusician.com
wolfgang
 
Posts: 281
Joined: Tue Dec 12, 2000 4:22 am
Location: USA

Postby The_Nerd on Tue May 20, 2003 3:48 am

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.
Q: What do you call a computer that won't come out of sleep?

A: A WindoZz box.
The_Nerd
 
Posts: 10
Joined: Mon Jan 06, 2003 8:55 pm
Location: USA

Postby KOU on Fri May 23, 2003 5:20 pm

I thought it was able to catch the close message by using guy
's extentions.

KOU
KOU
 
Posts: 92
Joined: Mon Mar 18, 2002 8:04 pm
Location: USA

Postby The_Nerd on Fri May 23, 2003 6:45 pm

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.
Q: What do you call a computer that won't come out of sleep?

A: A WindoZz box.
The_Nerd
 
Posts: 10
Joined: Mon Jan 06, 2003 8:55 pm
Location: USA

Postby KOU on Fri May 23, 2003 7:56 pm

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
KOU
 
Posts: 92
Joined: Mon Mar 18, 2002 8:04 pm
Location: USA

Postby The_Nerd on Sat May 24, 2003 4:21 am

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.
Q: What do you call a computer that won't come out of sleep?

A: A WindoZz box.
The_Nerd
 
Posts: 10
Joined: Mon Jan 06, 2003 8:55 pm
Location: USA

Postby Mickle on Sat May 24, 2003 3:17 pm

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;
        }
    }
}
Mickle
 
Posts: 48
Joined: Wed Apr 17, 2002 1:22 am
Location: Russia

Postby The_Nerd on Tue May 27, 2003 6:08 pm

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.
Q: What do you call a computer that won't come out of sleep?

A: A WindoZz box.
The_Nerd
 
Posts: 10
Joined: Mon Jan 06, 2003 8:55 pm
Location: USA

Postby Mickle on Tue May 27, 2003 7:55 pm

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).
Mickle
 
Posts: 48
Joined: Wed Apr 17, 2002 1:22 am
Location: Russia

Postby The_Nerd on Thu May 29, 2003 8:34 pm

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.
Q: What do you call a computer that won't come out of sleep?

A: A WindoZz box.
The_Nerd
 
Posts: 10
Joined: Mon Jan 06, 2003 8:55 pm
Location: USA


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron