Push down a button in a dialog 
Author Message
 Push down a button in a dialog

Hi there,

how can i tell a Dialog to start an action without pressing a button?
But the real problem is, that i don't know how to create a small Window
in order to write some text and a progressbar. That's why i am using a
Dialog-Window. But i dont't want to press a button. Is there a way?

Rgds
  Bodo



Sun, 15 Sep 2002 03:00:00 GMT  
 Push down a button in a dialog
Bodo!
You can post a message to yourself (if you want the process to start just
after the dialog box is shown, post it from OnInitDialog).

It you want to make it the easy way (I sense a newbie here:)))), create a
button on the dialog, use the ClassWizard to map a function to the button,
delete the button, but not the handler.
Use PostMessage(WM_COMMAND, MAKELPARAM(IDC_BUTTON, BN_CLICKED),0) to trigger
the 'button'. Of course, you'll have to modify the value IDC_BUTTON to
whatever the original button was called.

Johan Rosengren
Responsable Informatique
PACTA S.A.



Quote:
> Hi there,

> how can i tell a Dialog to start an action without pressing a button?
> But the real problem is, that i don't know how to create a small Window
> in order to write some text and a progressbar. That's why i am using a
> Dialog-Window. But i dont't want to press a button. Is there a way?

> Rgds
>   Bodo



Sun, 15 Sep 2002 03:00:00 GMT  
 Push down a button in a dialog
Hi Johan,

thank you, that works ,but the window is not shown. Hm, what can i do?

Johan Rosengren schrieb:

Quote:

> Bodo!
> You can post a message to yourself (if you want the process to start just
> after the dialog box is shown, post it from OnInitDialog).

> It you want to make it the easy way (I sense a newbie here:)))), create a
> button on the dialog, use the ClassWizard to map a function to the button,
> delete the button, but not the handler.
> Use PostMessage(WM_COMMAND, MAKELPARAM(IDC_BUTTON, BN_CLICKED),0) to trigger
> the 'button'. Of course, you'll have to modify the value IDC_BUTTON to
> whatever the original button was called.

> Johan Rosengren
> Responsable Informatique
> PACTA S.A.



Mon, 16 Sep 2002 03:00:00 GMT  
 Push down a button in a dialog
Bodo!

What window !???!

Johan Rosengren
Responsable Informatique
PACTA S.A.



Quote:
> Hi Johan,

> thank you, that works ,but the window is not shown. Hm, what can i do?

> Johan Rosengren schrieb:

> > Bodo!
> > You can post a message to yourself (if you want the process to start
just
> > after the dialog box is shown, post it from OnInitDialog).

> > It you want to make it the easy way (I sense a newbie here:)))), create
a
> > button on the dialog, use the ClassWizard to map a function to the
button,
> > delete the button, but not the handler.
> > Use PostMessage(WM_COMMAND, MAKELPARAM(IDC_BUTTON, BN_CLICKED),0) to
trigger
> > the 'button'. Of course, you'll have to modify the value IDC_BUTTON to
> > whatever the original button was called.

> > Johan Rosengren
> > Responsable Informatique
> > PACTA S.A.



Mon, 16 Sep 2002 03:00:00 GMT  
 Push down a button in a dialog
Hi,

sorry, i mean the dialog-box! So i am not able to see what the "task" is
doing! By the way - is there a way to create a resource which i can
import with the resource editor? Its very boring doing this with
create() and CRect()...

Rgds,
  Bodo

Johan Rosengren schrieb:

Quote:

> Bodo!

> What window !???!

> Johan Rosengren
> Responsable Informatique
> PACTA S.A.



> > Hi Johan,

> > thank you, that works ,but the window is not shown. Hm, what can i do?

> > Johan Rosengren schrieb:

> > > Bodo!
> > > You can post a message to yourself (if you want the process to start
> just
> > > after the dialog box is shown, post it from OnInitDialog).

> > > It you want to make it the easy way (I sense a newbie here:)))), create
> a
> > > button on the dialog, use the ClassWizard to map a function to the
> button,
> > > delete the button, but not the handler.
> > > Use PostMessage(WM_COMMAND, MAKELPARAM(IDC_BUTTON, BN_CLICKED),0) to
> trigger
> > > the 'button'. Of course, you'll have to modify the value IDC_BUTTON to
> > > whatever the original button was called.

> > > Johan Rosengren
> > > Responsable Informatique
> > > PACTA S.A.

--
Mit freundlichem Gru?
i.A. Bodo Hansen

+ KomTel
+ Gesellschaft fuer Kommunikations-
+ und Informationsdienste mbH
+
+ Bodo Hansen
+ Nordstr. 2, D-24937 Flensburg
+
+ Fon:      +49-461-9090-028
+ Fax:      +49-461-9090-091
+ Mobile:   +49-177-8080-934

+ Internet: http://www.komtel.net
+
-----------------------------------------------------------------------------
+



Mon, 16 Sep 2002 03:00:00 GMT  
 Push down a button in a dialog
Bodo!

I have no idea if I have understood you correctly - but you want to trigger
an operation from the startup of the dialog, ok?
And perhaps it is a long one? In that case, you might either have used
SendMessage instead of PostMessage, or the process is so hogging that your
dialog will not get a chance to redraw.

If the latter is the case, you will either want to

1. Put your lengthy process in a separate thread.

2. Chop up your operation in small parts, posting a message to continue the
operation until finished. Using the method of faking a button press
outlined, you could do something like this in the handler (in pseudocode):

...OnButton()
{
 static int X = 0;

 do step X of the operation
 increase X
 if X is not at the end of whatever
  PostMessage(WM_COMMAND... etc

Quote:
}

Where do you want to create the resource? Normally you can *draw* it in the
resource editor :)))

Johan Rosengren
Responsable Informatique
PACTA S.A.



Quote:
> Hi,

> sorry, i mean the dialog-box! So i am not able to see what the "task" is
> doing! By the way - is there a way to create a resource which i can
> import with the resource editor? Its very boring doing this with
> create() and CRect()...

> Rgds,
>   Bodo

> Johan Rosengren schrieb:

> > Bodo!

> > What window !???!

> > Johan Rosengren
> > Responsable Informatique
> > PACTA S.A.



> > > Hi Johan,

> > > thank you, that works ,but the window is not shown. Hm, what can i do?

> > > Johan Rosengren schrieb:

> > > > Bodo!
> > > > You can post a message to yourself (if you want the process to start
> > just
> > > > after the dialog box is shown, post it from OnInitDialog).

> > > > It you want to make it the easy way (I sense a newbie here:)))),
create
> > a
> > > > button on the dialog, use the ClassWizard to map a function to the
> > button,
> > > > delete the button, but not the handler.
> > > > Use PostMessage(WM_COMMAND, MAKELPARAM(IDC_BUTTON, BN_CLICKED),0) to
> > trigger
> > > > the 'button'. Of course, you'll have to modify the value IDC_BUTTON
to
> > > > whatever the original button was called.

> > > > Johan Rosengren
> > > > Responsable Informatique
> > > > PACTA S.A.

> --
> Mit freundlichem Gru?
> i.A. Bodo Hansen

> + KomTel
> + Gesellschaft fuer Kommunikations-
> + und Informationsdienste mbH
> +
> + Bodo Hansen
> + Nordstr. 2, D-24937 Flensburg
> +
> + Fon:      +49-461-9090-028
> + Fax:      +49-461-9090-091
> + Mobile:   +49-177-8080-934

> + Internet: http://www.komtel.net
> +
> --------------------------------------------------------------------------
---
> +



Mon, 16 Sep 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. remove push button from dialog

2. Push the button on a dialog

3. How to Disable a Push Button is a Dialog

4. Default push buttons on dialogs

5. Hyperlink Buttons to appear as push button

6. WANTED Code for Push Down Automata and Linear Bounded Automata

7. how to push down error-msg from ODBC-Driver

8. how to push down error-msg from ODBC-Driver

9. Win32 push button.

10. How to tell if a button was pushed.

11. Creating my own push button

12. How can I show a push button !!

 

 
Powered by phpBB® Forum Software