English
Forum

Prog. with stop fensterschließen Cross not working?

 

Manfred
Barei
Hi,

have with folgendem Prog. code something Problems and of course läst itself the window not any more over the close Cross terminate.
CompileMarkSeparation
proc prgexit

    MessageBox("Programm  beenden?","Frage:",36)

    if %Button = 6

        ende& = 1
        ASSIGN #1,PrgDir$+"NACHN.BMP"
        ASSIGN #2,PrgDir$+"ABS.BMP"
        ASSIGN #3,PrgDir$+"EMP.BMP"
        ERASE #1
        ERASE #2
        ERASE #3

    endif

    SetMenuItem 0
    SETFOCUS(%HWND)

endproc

proc anzeige

    DECLARE ende&
    DECLARE Formular&, Datenbank&
    SETTRUECOLOR 1
    WINDOWSTYLE 538
    window (%MaxX+2),((%MaxY/2)-250)-596,510
    GETSYSCOLOR(15)
    PopUp "&Datei"
    AppendMenu 102,"D&rucken"
    Separator
    AppendMenu 190,"&Ende"
    SetWindowPos %HWnd=((%MaxX/2)-298),((%MaxY/2)-250)-596,510;0
    ende&=0
    SETFOCUS(%HWND)

    whilenot ende&

        sleep 100

        If @MenuItem(190) or (%Key = 2)

            prgexit

        ELSEIF GETFOCUS(Formular&)

        ELSEIF GETFOCUS(Datenbank&)

        endif

    ENDWHILE

endproc

display

I need The Whilschleife but with a sleep, it must still possible his, have the too irgentwo once red, find But not any more.

I hope your can help.

Grus from the Heath of Manfred
Windows XP Prof. , Profan 8/9
 
Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 |
02/03/05  
 




Manfred
Barei
Hello again,

Soory, it comes always a Error Message the The Variable PrgDir$ not Declariert is, Please comment.
have whom Prog. code from my ongoing Program entnommen and this example forget The Variable To delete.

Grus Manfred
 
Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 |
02/03/05  
 




Michael
Dell
Hello Manfred,

versuchs time so:
CompileMarkSeparation
whilenot ende&

    sleep 100

    If @MenuItem(190) or (%Key = 2) or (%MenuItem = -2)

        prgexit

    ELSEIF GETFOCUS(Formular&)

    ELSEIF GETFOCUS(Datenbank&)

    endif

Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
02/03/05  
 




Manfred
Barei
Hello Michael,

thanks for response, have I but already probiert ( working not).

Grus Manfred
 
Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 |
02/03/05  
 




CB
Hi,
probier time the:

DEF &WM_CLOSE $010
DEF &WM_COMMAND $0111
User Messages &WM_COMMAND,&WM_CLOSE

into Hauptschleife: (only in principle, be in haste):

Whilenot Ende&
Sleep 100
Waitinput
If %UMessage = &WM_CLOSE
Ende& = 1
ElseIf %UMessage = &WM_COMMAND
If &ULParam = Formular&
.
.
.

Sincerely,
Christian
 
XProfan 8/9.1, Win XP, AMD 64/3200
02/03/05  
 



the You a While-Loop benötigst - with a Sleep - is so hope I only The half-way truth.

Perhaps want You but too only the the program weiterläuft During low which The Hauptroutine The normalen releases Done.

very for Gibts The Thread.pcu

five Lines More and you have the desired Result:
CompileMarkSeparation
 $U thread.pcu = thread.

proc prgexit

    MessageBox("Programm  beenden?","Frage:",36)

    if %Button = 6

        ende& = 1
        ASSIGN #1,PrgDir$+"NACHN.BMP"
        ASSIGN #2,PrgDir$+"ABS.BMP"
        ASSIGN #3,PrgDir$+"EMP.BMP"
        ERASE #1
        ERASE #2
        ERASE #3

    endif

    SetMenuItem 0
    SETFOCUS(%HWND)

endproc

proc anzeige

    DECLARE ende&
    DECLARE Formular&, Datenbank&
    SETTRUECOLOR 1
    WINDOWSTYLE 538
    window (%MaxX+2),((%MaxY/2)-250)-596,510
    PopUp "&Datei"
    AppendMenu 102,"D&rucken"
    Separator
    AppendMenu 190,"&Ende"
    SetWindowPos %HWnd=((%MaxX/2)-298),((%MaxY/2)-250)-596,510;0
    ende&=0
    SETFOCUS(%HWND)
    thread.start 1

    whilenot ende&

        waitinput

        If @MenuItem(190) or (%Key = 2)

            prgexit

        ELSEIF GETFOCUS(Formular&)

        ELSEIF GETFOCUS(Datenbank&)

        endif

    ENDWHILE

    thread.stop 1

endproc

proc thread.do

    settext %hwnd,time$(0)+"."+time$(1)

endproc

='./../../references-fonction/XProfan/display/'>display
salvo, iF
 
02/03/05  
 




Manfred
Barei
Hi,

To Christian: the Waitinput can I in this Loop not use, therefore sleep.

To IF: No, I custom The Loop with a sleep since the Loop with a Waitinput not functions.
tappt im dunkeln lodging-house keeper in between always time again quizzed.

The Loop becomes After pressing one Buttons leave and verzweigt in a Unterschleife. The Hauptschleife becomes but over ands over again time quizzed.

circa now not The entire CPU-Auslastung this Program zuzuteilen the sleep.

I hope I have me verständlich framed.

Grus Manfred
 
Zu wenig Wissen ist gefärlich, zu viel auch.(XProfan X4) | Win 10 Pro 64 | Win7 Ultimate 32/64 | AMD FX-8320, 16GB, GeForce GT 630 |
02/03/05  
 



look you still again my Source on - the power very the what You want. Look you too times the Help to Thread.Pcu on. You must still not the Hauptprogramm with the Gewurstel keep busy - particularly if you still eigendlich the Waitinput need. For this is the procedure Thread.Do still there.

i think if you one bisl umdenkst is the very the what You need.

salvo, iF
 
02/03/05  
 




Rolf
Koch
Hi Manfred,

jawohl, IFs Thread.pcu is really what You benötigst!
several Timer settle, different Topics on the side inquire and Edit (dato were it still up to 5, IF?) and this with 0% Prozessorauslastung in the Hauptprogramm.
Vorallem The Integration is mind. just as simply as if one a Timer setting.

Rolf (Hatschi )
 
02/03/05  
 




Jörg
Sellmeyer
Hello Manfred,
so should it too with your code functions:
CompileMarkSeparation
proc prgexit

    MessageBox("Programm  beenden?","Frage:",36)

    if %Button = 6

        ende& = 1
        KillTimerTimer freigeben
        ASSIGN #1,PrgDir$+"NACHN.BMP"
        ASSIGN #2,PrgDir$+"ABS.BMP"
        ASSIGN #3,PrgDir$+"EMP.BMP"
        ERASE #1
        ERASE #2
        ERASE #3

    endif

    SetMenuItem 0
    SETFOCUS(%HWND)

endproc

proc anzeige

    DECLARE ende&
    DECLARE Formular&, Datenbank&
    SETTRUECOLOR 1
    WINDOWSTYLE 538
    window (%MaxX+2),((%MaxY/2)-250)-596,510
    GETSYSCOLOR(15)
    PopUp "&Datei"
    AppendMenu 102,"D&rucken"
    Separator
    AppendMenu 190,"&Ende"
    SetWindowPos %HWnd=((%MaxX/2)-298),((%MaxY/2)-250)-596,510;0
    ende&=0
    SETFOCUS(%HWND)
    SetTimer 1je kleiner der Timer, desto besser reagiert das Programm
    ob 1 oder 100 hat auf die CPUauslastung ca. 5%-10% Auswirkung

    whilenot ende&

        CaseNot %wmtimer:WaitiInput

        If @MenuItem(190) or (%Key = 2)

            prgexit

        ELSEIF GETFOCUS(Formular&)

        ELSEIF GETFOCUS(Datenbank&)

        endif

    ENDWHILE

endproc

/../references-fonction/XProfan/display/'>display

Greeting
Jörg
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
02/03/05  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.131 Views

Untitledvor 0 min.
H.Brill09/13/22
Walter05/10/21
W.L.07/19/17
Deaktiviert02/04/17
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie