The Problem Of Using MessageBox() Of Win32 API
2013-08-05 13:09
330 查看
When we used the API MessageBox() of win32,we found that it required 4 parameters,this was not like that in MFC can recieve 1 parameter.
So,how can we use it?
Here is the introduction in MSDN for C++ 6.0:
Well,we can do this:
MessageBox(NULL,"Hello Win32","Message",MB_OK);//The parameter 1 is NULL means the MessageBox's parent window is desktop.
And,it can be used.
However,if we want to display an integer,how can we do?
Well,we can use the funtion "wsprintf" which is in <windows.h>.
Here is the introduction in MSDN for C++ 6.0:
And,we can do this:
DWORD dwNum=5201314;
char Buffer[100];
wsprintf(Buffer,"%s",dwNum);
MessageBox(NULL,Buffer,"I Love You",MB_OK);
So,above is the problem of win32's MessageBox,if someone has some advice,please comment,thanks a lot!
So,how can we use it?
Here is the introduction in MSDN for C++ 6.0:
int MessageBox( HWND hWnd, // handle of owner window LPCTSTR lpText, // address of text in message box LPCTSTR lpCaption, // address of title of message box UINT uType // style of message box );
Well,we can do this:
MessageBox(NULL,"Hello Win32","Message",MB_OK);//The parameter 1 is NULL means the MessageBox's parent window is desktop.
And,it can be used.
However,if we want to display an integer,how can we do?
Well,we can use the funtion "wsprintf" which is in <windows.h>.
Here is the introduction in MSDN for C++ 6.0:
int wsprintf( LPTSTR lpOut, // pointer to buffer for output LPCTSTR lpFmt, // pointer to format-control string ... // optional arguments );
And,we can do this:
DWORD dwNum=5201314;
char Buffer[100];
wsprintf(Buffer,"%s",dwNum);
MessageBox(NULL,Buffer,"I Love You",MB_OK);
So,above is the problem of win32's MessageBox,if someone has some advice,please comment,thanks a lot!
相关文章推荐
- What are some of the differences between using recursion to solve a problem versus using iteration?
- .NET Framework Solutions: In Search of the Lost Win32 API
- Unable to determine the principal end of an association between the types '***. The principal end of this association must be explicitly configured using either the relationship fluent API or data annotations.
- The problem of using Sharepoint Designer
- google api , the problem of null refresh token
- Send Raw Data to a Printer by Using the Win32 API
- The unique identifier of the win32 class is the class name
- Best practice: Para-virtualize devices by using the VirtIO API
- Crusher the process of using these points we need to remember that
- zoj 2818 Root of the Problem
- Problem 10 of Find the sum of all the primes below two million.
- How to Simulate the Price Order or Price Line Function using API QP_PREQ_PUB.PRICE_REQUEST Includes
- Jaw Crusher to solve the problem of cement production
- ZOJ Problem Set - 3880||Demacia of the Ancients
- “API design is like sex: Make one mistake and support it for the rest of your life.”
- Are you looking for a way to get the entire text of a word document into a RichEdit without using the Clipboard?
- 使用游标批量更新/填充数据库(The Using of Cursor)
- The problem of getting ior by https
- Most of these Diesel-engined wristwatches wall socket available for purchase are designed when using the similar premium quality products
- chrome视频无法播放的解决方法(Solve the problem of Google player cannot be played normally)