Tamam, bu programda, bir yürütülebilir dosyayı derlemek için Code :: Blocks IDE ve GNU GCC derleyicisini kullanıyorum. Bir Win32 GUI projesidir. Benim sorunum, her ne kadar hepsi çalışıyor olsa da, son zamanlarda onları çalışmak için & onları kodlamak için düğmeleri tıklayarak uygulamak için çalıştı. Adam kodu/Düğme tıklandığında tespit ediliyor mu? [C++, WinAPI]
Error: ||=== Build file: Release in Agsploit (compiler: GNU GCC Compiler) ===| C:\Users\PC\Desktop\Agsploit\main.cpp||In function 'int WinMain(HINSTANCE, HINSTANCE, LPSTR, int)':| C:\Users\PC\Desktop\Agsploit\main.cpp|14|error: expected unqualified-id before numeric constant| C:\Users\PC\Desktop\Agsploit\main.cpp|55|note: in expansion of macro 'Execute'| ||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
Kod (Maalesef emin değilim burada biçimlendirmek nasıl, bu yüzden pastebin'd) çalışması gerektiğini söyledi Ancak, ben, garip bir hatayı alıyorum: http://pastebin.com/raw/r6b5NcXK
#if defined(UNICODE) && !defined(_UNICODE)
#define _UNICODE
#elif defined(_UNICODE) && !defined(UNICODE)
#define UNICODE
#endif
#include <tchar.h>
#include <windows.h>
LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM);
TCHAR szClassName[] = _T("WindowClass");
#define Execute 0
#define RunScript 1
#define Clear 2
#define Help 3
#define Credits 4
#define Commands 5
#define Exit 6
int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow) {
HWND hwnd;
MSG messages;
WNDCLASSEX wincl;
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure;
wincl.style = CS_DBLCLKS;
wincl.cbSize = sizeof (WNDCLASSEX);
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
if (!RegisterClassEx (&wincl)) {
return 0;
};
hwnd = CreateWindowEx(
0,
szClassName,
_T("LightNinG || v1 || By: [Team AzuL]"),
WS_OVERLAPPEDWINDOW^WS_THICKFRAME,
400,
200,
740,
390,
HWND_DESKTOP,
NULL,
hThisInstance,
NULL
);
HWND Execute = CreateWindow(
"BUTTON",
"Execute",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
250,
315,
235,
50,
hwnd,
(HMENU)Execute,
(HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE),
NULL
);
HWND ScriptButton = CreateWindow(
"BUTTON",
"Run script",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
485,
315,
250,
50,
hwnd,
(HMENU)RunScript,
(HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE),
NULL
);
HWND Clear = CreateWindow(
"BUTTON",
"Clear",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
0,
315,
250,
50,
hwnd,
(HMENU)Clear,
(HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE),
NULL
);
HWND Help = CreateWindow(
"BUTTON",
"Help",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
400,
0,
85,
84,
hwnd,
(HMENU)Help,
(HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE),
NULL
);
HWND Credits = CreateWindow(
"BUTTON",
"Credits",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
400,
84,
85,
84,
hwnd,
(HMENU)Credits,
(HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE),
NULL
);
HWND Commands = CreateWindow(
"BUTTON",
"Commands",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
400,
168,
85,
84,
hwnd,
(HMENU)Commands,
(HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE),
NULL
);
HWND Exit = CreateWindow(
"BUTTON",
"Exit",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
400,
252,
85,
64,
hwnd,
(HMENU)Exit,
(HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE),
NULL
);
HWND OutputWindow = CreateWindow("Edit", "Hello, and welcome to LightNinG by Team AzuL.\r\nCurrent version: 1\r\nCurrent # of commands: 0", WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL | ES_AUTOHSCROLL | ES_MULTILINE | ES_READONLY, 0, 0, 400, 290, hwnd, NULL, NULL, NULL);
HWND InputBar = CreateWindow("Edit", "Input commands here.", WS_CHILD | WS_VISIBLE | WS_BORDER, 0, 290, 400, 25, hwnd, NULL, NULL, NULL);
HWND ScriptBox = CreateWindow("Edit", "Script(s) go here {client-sided}.", WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL | ES_AUTOHSCROLL | ES_MULTILINE, 485, 0, 250, 314, hwnd, NULL, NULL, NULL);
ShowWindow (hwnd, nCmdShow);
while (GetMessage(&messages, NULL, 0, 0)) {
TranslateMessage(&messages);
DispatchMessage(&messages);
};
return messages.wParam;
};
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
switch (message) {
case WM_COMMAND:
switch(LOWORD(wParam)) {
case Execute:
break;
case RunScript:
break;
case Clear:
break;
case Help:
break;
case Credits:
MessageBox(NULL, (LPCWSTR)L"Created by team AzuL.", (LPCWSTR)L"Credits", MB_OK);
break;
case Commands:
break;
case Exit:
break;
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, message, wParam, lParam);
};
return 0;
};
Teşekkürler mah, bana bunu nasıl yaptığını söyleyebilir misin? –
Kodu yapıştırdım, hepsini seçtim ve K tuşuna basıyorum. Bu, her satırın başına sadece 4 alan ekleyen bir kısayoldur. – mah
Ah teşekkürler, biçimlendirmememin sebebi, bir seferde nasıl yapılacağının farkında olmamamdı. Bir süreliğine olurdu. –