6 Replies - 1408 Views - Last Post: 12 May 2010 - 12:53 PM Rate Topic: -----

#1 vitrix  Icon User is offline

  • New D.I.C Head

Reputation: -13
  • View blog
  • Posts: 26
  • Joined: 01-May 10

c++ basic question exite msgbox

Posted 11 May 2010 - 04:39 PM

hello guys im new in c++
just for ask a question
my english is not perfect im sorry but i go try explain

i tryed use this show msg box and exite program but

code:

MessageBoxA(NULL, "this is vitrix test dll", "Vitrix", MB_ICONEXCLAMATION | MB_OK);
ExitProcess (0);

but if i click ok in msgbox program exite


i want to close program first and then show msgbox

who can help my?.

code :

Code:

if(DeleteFile( _T( "map.dll" ) ) == true)
{
MessageBoxA(NULL, "this is vitrix test dll", "Vitrix", MB_ICONEXCLAMATION | MB_OK);
ExitProcess (0);
}else
{
BeepSong();
}




Is This A Good Question/Topic? 0
  • +

Replies To: c++ basic question exite msgbox

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6039
  • View blog
  • Posts: 23,437
  • Joined: 23-August 08

Re: c++ basic question exite msgbox

Posted 11 May 2010 - 05:22 PM

Huh??? Why are you back here? I thought this was a "shit forum"??? You know, the one where you insulted our members directly?
Was This Post Helpful? 1
  • +
  • -

#3 vitrix  Icon User is offline

  • New D.I.C Head

Reputation: -13
  • View blog
  • Posts: 26
  • Joined: 01-May 10

Re: c++ basic question exite msgbox

Posted 11 May 2010 - 05:34 PM

View PostJackOfAllTrades, on 11 May 2010 - 04:22 PM, said:

Huh??? Why are you back here? I thought this was a "shit forum"??? You know, the one where you insulted our members directly?


bro i dont insult you started why u guys have this forum ? for help k ?

and u say no 1 going to help me
all u doing here is click in red Reputation button i respected you
but u dont like me bcz im no english
you are just a bad person i think ? not sure.

i dont insulted no 1 here dont say bullshit please

This post has been edited by vitrix: 11 May 2010 - 05:37 PM

Was This Post Helpful? -1
  • +
  • -

#4 eker676  Icon User is offline

  • Software Engineer
  • member icon

Reputation: 378
  • View blog
  • Posts: 1,833
  • Joined: 18-April 09

Re: c++ basic question exite msgbox

Posted 11 May 2010 - 07:17 PM

To answer your question, you can't.

You cannot close the program and then have it display a message box. Why? Because the program is no longer running. You can hide the program temporarily and then display the message box but you can't close it.
Was This Post Helpful? 1
  • +
  • -

#5 vitrix  Icon User is offline

  • New D.I.C Head

Reputation: -13
  • View blog
  • Posts: 26
  • Joined: 01-May 10

Re: c++ basic question exite msgbox

Posted 11 May 2010 - 10:21 PM

View Posteker676, on 11 May 2010 - 06:17 PM, said:

To answer your question, you can't.

You cannot close the program and then have it display a message box. Why? Because the program is no longer running. You can hide the program temporarily and then display the message box but you can't close it.

ok i have tryed i cant can u help me please?

i can pay if u want or JackOfAllTrades go say bullshit again rofl

This post has been edited by vitrix: 11 May 2010 - 10:41 PM

Was This Post Helpful? -1
  • +
  • -

#6 eker676  Icon User is offline

  • Software Engineer
  • member icon

Reputation: 378
  • View blog
  • Posts: 1,833
  • Joined: 18-April 09

Re: c++ basic question exite msgbox

Posted 12 May 2010 - 12:43 PM

Tried to what? Close it, or hide it.

If you were going to hide it then...
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <iostream>
int main()
{
HWND hWnd = GetConsoleWindow();
ShowWindow( hWnd, SW_HIDE );

return 0;
}


That code was taken from here:
http://hackerslife.b...indow-in-c.html
Was This Post Helpful? 0
  • +
  • -

#7 FrozenSnake  Icon User is offline

  • En man från Sverige!

Reputation: 122
  • View blog
  • Posts: 995
  • Joined: 30-July 08

Re: c++ basic question exite msgbox

Posted 12 May 2010 - 12:53 PM

Didnt you get your answer here?
http://forum.codecal...ite-msgbox.html
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1