mirror of
https://github.com/reactos/reactos.git
synced 2025-06-16 12:48:31 +00:00
[MSPAINT] use __targv[1] instead of lpszArgument
This should make Paint's handling of command line strings less brittle. CORE-13293
This commit is contained in:
parent
c434a5ab21
commit
313ded449c
1 changed files with 3 additions and 3 deletions
|
@ -259,15 +259,15 @@ _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument
|
||||||
RECT imageAreaPos = {3, 3, 3 + imageModel.GetWidth(), 3 + imageModel.GetHeight()};
|
RECT imageAreaPos = {3, 3, 3 + imageModel.GetWidth(), 3 + imageModel.GetHeight()};
|
||||||
imageArea.Create(scrlClientWindow.m_hWnd, imageAreaPos, NULL, WS_CHILD | WS_VISIBLE);
|
imageArea.Create(scrlClientWindow.m_hWnd, imageAreaPos, NULL, WS_CHILD | WS_VISIBLE);
|
||||||
|
|
||||||
if (lpszArgument[0] != 0)
|
if (__argc >= 2)
|
||||||
{
|
{
|
||||||
HBITMAP bmNew = NULL;
|
HBITMAP bmNew = NULL;
|
||||||
LoadDIBFromFile(&bmNew, lpszArgument, &fileTime, &fileSize, &fileHPPM, &fileVPPM);
|
LoadDIBFromFile(&bmNew, __targv[1], &fileTime, &fileSize, &fileHPPM, &fileVPPM);
|
||||||
if (bmNew != NULL)
|
if (bmNew != NULL)
|
||||||
{
|
{
|
||||||
TCHAR *temp;
|
TCHAR *temp;
|
||||||
imageModel.Insert(bmNew);
|
imageModel.Insert(bmNew);
|
||||||
GetFullPathName(lpszArgument, SIZEOF(filepathname), filepathname, &temp);
|
GetFullPathName(__targv[1], SIZEOF(filepathname), filepathname, &temp);
|
||||||
CPath pathFileName(filepathname);
|
CPath pathFileName(filepathname);
|
||||||
pathFileName.StripPath();
|
pathFileName.StripPath();
|
||||||
CString strTitle;
|
CString strTitle;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue