Contribute  :  Web Resources  :  Past Polls  :  Site Statistics  :  Downloads  :  Forum  
    BiW ReversingThe challenge is yours    
 Welcome to BiW Reversing
 Tuesday, November 30 2021 @ 01:53 AM CET
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dialog..that waits

 
Post new topic   Reply to topic    www.reversing.be Forum Index -> Code Reversing
View previous topic :: View next topic  
Author Message
jackall
New to the board
New to the board


Joined: 25 Feb 2008
Posts: 10
Location: india

PostPosted: Sun May 18, 2008 5:25 pm    Post subject: Dialog..that waits Reply with quote

Many members of this forum in the past have helped me by sharing their widespread knowledge and immense experience in programming. I learned little by little from the suggestions and tips given by them. Thanks .

As part of that process…
I understand that Dialog box is a small window that waits for information from the user; having received that info, it bows out without a sound.

But how to create one? That is my issue now. Please look at these lines...

#include<iostream>
#include<windows.h>
using namespace std;

int main () {
string nme;

cout<<"Enter name\n";
cin>>nme;
cin.ignore ();
if(nme=="abc"){

MessageBoxA(NULL,"..","Right",MB_OK|MB_TOPMOST);
}else{
MessageBoxA(NULL,"..","Wrong",MB_OK|MB_TOPMOST);
}
cin.get();
//return 0;
}

The Dos window where we input information has to be replaced by a Dialog box.
..that waits for information.

Regards..
Back to top
View user's profile Send private message Send e-mail
detten
Site Admin


Joined: 05 Feb 2005
Posts: 317

PostPosted: Mon May 19, 2008 6:08 pm    Post subject: Reply with quote

There are 2 things to be done :

1) Change the program from console to windows application.
Use a WinMain function instead of the regular main.

2) Call the DialogBox() function to display a dialog. (You need a resource as well that describes what the dialogbox looks like)

This probably doesn't mean much to you, but all will get clear if you go through these nice and compact tutorials (I started with those a long time ago, and they helped me a lot) :

http://www.winprog.org/tutorial/start.html

part 7 describes dialogboxes in detail. Have fun Smile

_________________
Ignorance is bliss, knowledge is power
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.reversing.be Forum Index -> Code Reversing All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
 Copyright © 2021 BiW Reversing
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.93 seconds