Accueil > Forum > > > > PB EditBox
PB EditBox
vendredi 30 mai 2003 à 16:15:14 |
PB EditBox

SfyLer
|
Bonjour à tous ! J'ai créé un scanner de port sous dos, et j'ai commencer a le faire sous windows, j'ai presque fini le seul pb que j'ai c'est que je ne sait pas comment les editbox peuvent ecrire dans les variables IP et PORT. Voici la source vous comprendrez mieu #include "stdafx.h" #include "resource.h" #include <stdio.h> #include <iostream.h> #include <time.h> #include <conio.h> #include <istream.h> #pragma comment(lib, "ws2_32.lib") #include <winsock2.h> #define MAX_LOADSTRING 100 #define ID_BUTTON 100 #define ID_EDITBOX 100 // Global Variables: HINSTANCE hInst; // current instance TCHAR szTitle[MAX_LOADSTRING]; // The title bar text TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text // Foward declarations of functions included in this code module: ATOM MyRegisterClass(HINSTANCE hInstance); BOOL InitInstance(HINSTANCE, int); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // TODO: Place code here. MSG msg; HACCEL hAccelTable; // Initialize global strings LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(hInstance, IDC_SCANNERBYSFYLER, szWindowClass, MAX_LOADSTRING); MyRegisterClass(hInstance); // Perform application initialization: if (!InitInstance (hInstance, nCmdShow)) { return FALSE; } hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_SCANNERBYSFYLER); // Main message loop: while (GetMessage(&msg, NULL, 0, 0)) { if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return msg.wParam; } // // FUNCTION: MyRegisterClass() // // PURPOSE: Registers the window class. // // COMMENTS: // // This function and its usage is only necessary if you want this code // to be compatible with Win32 systems prior to the 'RegisterClassEx' // function that was added to Windows 95. It is important to call this function // so that the application will get 'well formed' small icons associated // with it. // ATOM MyRegisterClass(HINSTANCE hInstance) { WNDCLASSEX wcex; wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = (WNDPROC)WndProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = hInstance; wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_SCANNERBYSFYLER); wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); wcex.lpszMenuName = (LPCSTR)IDC_SCANNERBYSFYLER; wcex.lpszClassName = szWindowClass; wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL); return RegisterClassEx(&wcex); } // // FUNCTION: InitInstance(HANDLE, int) // // PURPOSE: Saves instance handle and creates main window // // COMMENTS: // // In this function, we save the instance handle in a global variable and // create and display the main program window. // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { HWND hWnd; hInst = hInstance; // Store instance handle in our global variable hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 180, 250, HWND_DESKTOP, NULL, hInstance, NULL); HWND edithWnd = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "EDIT", "", WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL|ES_NOHIDESEL, 10, 10, 150, 25, hWnd, (HMENU)ID_EDITBOX, hInstance, NULL); SetWindowText(edithWnd, "IP"); HWND edithWnd1 = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "EDIT", "", WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL|ES_NOHIDESEL, 10, 50, 150, 25, hWnd, (HMENU)ID_EDITBOX, hInstance, NULL); SetWindowText(edithWnd1, "PORT"); // Création du bouton HWND cmdhWnd = CreateWindowEx(0, "BUTTON", "", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON|BS_NOTIFY|BS_TEXT, 10, 150, 150, 30, hWnd, (HMENU)ID_BUTTON, hInstance, NULL); SetWindowText(cmdhWnd, "Scan"); if (!hWnd) { return FALSE; } ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); return TRUE; } // // FUNCTION: WndProc(HWND, unsigned, WORD, LONG) // // PURPOSE: Processes messages for the main window. // // WM_COMMAND - process the application menu // WM_PAINT - Paint the main window // WM_DESTROY - post a quit message and return // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; TCHAR szHello[MAX_LOADSTRING]; LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING); switch (message) { case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); if ((LOWORD(wParam) == ID_BUTTON) && (HIWORD(wParam) == BN_CLICKED)) { MessageBox(hWnd, "Scan en cours", "Scanner", MB_OK|MB_ICONINFORMATION); WSADATA WSAData; // tout les prog de WSAStartup(MAKEWORD(2,0),&WSAData); SOCKET sock; SOCKADDR_IN sin; //ICI JAIMERAIS QUE CE SOIT LES EDIT BOX QUI REMPLISSE IP ET PORTsin.sin_addr.s_addr = inet_addr(IP); // definit les propriétés sin.sin_family = AF_INET; // de la socket sin.sin_port = htons(PORT); sock = socket(AF_INET,SOCK_STREAM,0); n = connect(sock,(SOCKADDR *)&sin,sizeof(sin)); if(n == 0) // si on peut se connecter (donc si le port est ouvert) { MessageBox(hWnd, "Le port est ouvert", "Scanner", MB_OK|MB_ICONINFORMATION); } else { MessageBox(hWnd, "Le port est fermé", "Scanner", MB_OK|MB_ICONINFORMATION); } closesocket(sock); WSACleanup(); //execution du code } // Parse the menu selections: switch (wmId) { case IDM_ABOUT: DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); break; case IDM_EXIT: DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); // TODO: Add any drawing code here... RECT rt; GetClientRect(hWnd, &rt); EndPaint(hWnd, &ps); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } // Mesage handler for about box. LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG: return TRUE; case WM_COMMAND: if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { EndDialog(hDlg, LOWORD(wParam)); return TRUE; } break; } return FALSE; } http://totalpcone.free.fr 
|
|
vendredi 30 mai 2003 à 16:23:07 |
Re : PB EditBox

BruNews
|
GetWindowText(hedit, szbuff, lenbuff); ou alors: GetDlgItemText(hdlg, IDED_IP, szbuff, lenbuff); donc si tu as char szIP[20]: nbrcaracs = GetWindowText(hedit, szIP, 20); BruNews, ciao... ------------------------------- Réponse au message : ------------------------------- > Bonjour à tous ! > J'ai créé un scanner de port sous dos, et j'ai commencer a le faire sous windows, j'ai presque fini le seul pb que j'ai c'est que je ne sait pas comment les editbox peuvent ecrire dans les variables IP et PORT. > Voici la source vous comprendrez mieu > > > #include "stdafx.h" > #include "resource.h" > #include <stdio.h> > #include <iostream.h> > #include <time.h> > #include <conio.h> > #include <istream.h> > #pragma comment(lib, "ws2_32.lib") > #include <winsock2.h> > > #define MAX_LOADSTRING 100 > #define ID_BUTTON 100 > #define ID_EDITBOX 100 > > // Global Variables: > HINSTANCE hInst; // current instance > TCHAR szTitle[MAX_LOADSTRING]; // The title bar text > TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text > > // Foward declarations of functions included in this code module: > ATOM MyRegisterClass(HINSTANCE hInstance); > BOOL InitInstance(HINSTANCE, int); > LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); > LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); > > int APIENTRY WinMain(HINSTANCE hInstance, > HINSTANCE hPrevInstance, > LPSTR lpCmdLine, > int nCmdShow) > { > // TODO: Place code here. > MSG msg; > HACCEL hAccelTable; > > // Initialize global strings > LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); > LoadString(hInstance, IDC_SCANNERBYSFYLER, szWindowClass, MAX_LOADSTRING); > MyRegisterClass(hInstance); > > // Perform application initialization: > if (!InitInstance (hInstance, nCmdShow)) > { > return FALSE; > } > > hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_SCANNERBYSFYLER); > > // Main message loop: > while (GetMessage(&msg, NULL, 0, 0)) > { > if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) > { > TranslateMessage(&msg); > DispatchMessage(&msg); > } > } > > return msg.wParam; > } > > > > // > // FUNCTION: MyRegisterClass() > // > // PURPOSE: Registers the window class. > // > // COMMENTS: > // > // This function and its usage is only necessary if you want this code > // to be compatible with Win32 systems prior to the 'RegisterClassEx' > // function that was added to Windows 95. It is important to call this function > // so that the application will get 'well formed' small icons associated > // with it. > // > ATOM MyRegisterClass(HINSTANCE hInstance) > { > WNDCLASSEX wcex; > > wcex.cbSize = sizeof(WNDCLASSEX); > > wcex.style = CS_HREDRAW | CS_VREDRAW; > wcex.lpfnWndProc = (WNDPROC)WndProc; > wcex.cbClsExtra = 0; > wcex.cbWndExtra = 0; > wcex.hInstance = hInstance; > wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_SCANNERBYSFYLER); > wcex.hCursor = LoadCursor(NULL, IDC_ARROW); > wcex.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); > wcex.lpszMenuName = (LPCSTR)IDC_SCANNERBYSFYLER; > wcex.lpszClassName = szWindowClass; > wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL); > > return RegisterClassEx(&wcex); > } > > // > // FUNCTION: InitInstance(HANDLE, int) > // > // PURPOSE: Saves instance handle and creates main window > // > // COMMENTS: > // > // In this function, we save the instance handle in a global variable and > // create and display the main program window. > // > BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) > { > HWND hWnd; > > hInst = hInstance; // Store instance handle in our global variable > > hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, > CW_USEDEFAULT, CW_USEDEFAULT, 180, 250, HWND_DESKTOP, NULL, hInstance, NULL); > HWND edithWnd = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "EDIT", "", WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL|ES_NOHIDESEL, > 10, 10, 150, 25, hWnd, (HMENU)ID_EDITBOX, hInstance, NULL); > SetWindowText(edithWnd, "IP"); > > HWND edithWnd1 = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "EDIT", "", WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL|ES_NOHIDESEL, > 10, 50, 150, 25, hWnd, (HMENU)ID_EDITBOX, hInstance, NULL); > SetWindowText(edithWnd1, "PORT"); > // Création du bouton > HWND cmdhWnd = CreateWindowEx(0, "BUTTON", "", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON|BS_NOTIFY|BS_TEXT, > 10, 150, 150, 30, hWnd, (HMENU)ID_BUTTON, hInstance, NULL); > SetWindowText(cmdhWnd, "Scan"); > > if (!hWnd) > { > return FALSE; > } > > ShowWindow(hWnd, nCmdShow); > UpdateWindow(hWnd); > > > return TRUE; > } > > // > // FUNCTION: WndProc(HWND, unsigned, WORD, LONG) > // > // PURPOSE: Processes messages for the main window. > // > // WM_COMMAND - process the application menu > // WM_PAINT - Paint the main window > // WM_DESTROY - post a quit message and return > // > // > LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) > { > int wmId, wmEvent; > PAINTSTRUCT ps; > HDC hdc; > TCHAR szHello[MAX_LOADSTRING]; > LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING); > > switch (message) > { > case WM_COMMAND: > wmId = LOWORD(wParam); > wmEvent = HIWORD(wParam); > if ((LOWORD(wParam) == ID_BUTTON) && (HIWORD(wParam) == BN_CLICKED)) > { > MessageBox(hWnd, "Scan en cours", "Scanner", MB_OK|MB_ICONINFORMATION); > > WSADATA WSAData; // tout les prog de > WSAStartup(MAKEWORD(2,0),&WSAData); > > SOCKET sock; > > SOCKADDR_IN sin; > //ICI JAIMERAIS QUE CE SOIT LES EDIT BOX QUI REMPLISSE IP ET PORT> sin.sin_addr.s_addr = inet_addr(IP); // definit les propriétés > sin.sin_family = AF_INET; // de la socket > sin.sin_port = htons(PORT); > > sock = socket(AF_INET,SOCK_STREAM,0); > n = connect(sock,(SOCKADDR *)&sin,sizeof(sin)); > if(n == 0) // si on peut se connecter (donc si le port est ouvert) > { > MessageBox(hWnd, "Le port est ouvert", "Scanner", MB_OK|MB_ICONINFORMATION); > } > else > { > MessageBox(hWnd, "Le port est fermé", "Scanner", MB_OK|MB_ICONINFORMATION); > > } > closesocket(sock); > WSACleanup(); > > > //execution du code > } > // Parse the menu selections: > switch (wmId) > { > case IDM_ABOUT: > DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); > break; > case IDM_EXIT: > DestroyWindow(hWnd); > break; > default: > return DefWindowProc(hWnd, message, wParam, lParam); > } > break; > case WM_PAINT: > hdc = BeginPaint(hWnd, &ps); > // TODO: Add any drawing code here... > RECT rt; > GetClientRect(hWnd, &rt); > > EndPaint(hWnd, &ps); > break; > > case WM_DESTROY: > PostQuitMessage(0); > break; > default: > return DefWindowProc(hWnd, message, wParam, lParam); > } > return 0; > } > > // Mesage handler for about box. > LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) > { > switch (message) > { > case WM_INITDIALOG: > return TRUE; > > case WM_COMMAND: > if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) > { > EndDialog(hDlg, LOWORD(wParam)); > return TRUE; > } > break; > } > return FALSE; > } > > > http://totalpcone.free.fr 
|
|
vendredi 30 mai 2003 à 17:07:33 |
Re : PB EditBox

SfyLer
|
merci beaucoup ! mais jai encore un blem pour le port: char *LePORT = NULL; unsigned int TextLen = 0; TextLen = GetWindowTextLength(EditHandle); LeText = new char[(TextLen + 2)]; TextLen = GetWindowText(EditHandle, LeText, (TextLen + 1)); Le pb c'est que sa, sa prend ce ke ya ecri dans le edit box et sa le met dans une variable char, et je narrive pas a ce ki prennent une variable int, pouvez vous juste modifier ce code pour ke sa marche ? http://totalpc.free.fr  ------------------------------- Réponse au message : ------------------------------- > GetWindowText(hedit, szbuff, lenbuff); > ou alors: > GetDlgItemText(hdlg, IDED_IP, szbuff, lenbuff); > donc si tu as char szIP[20]: > nbrcaracs = GetWindowText(hedit, szIP, 20); > BruNews, ciao... > > > ------------------------------- > Réponse au message : > ------------------------------- > > > Bonjour à tous ! > > J'ai créé un scanner de port sous dos, et j'ai commencer a le faire sous windows, j'ai presque fini le seul pb que j'ai c'est que je ne sait pas comment les editbox peuvent ecrire dans les variables IP et PORT. > > Voici la source vous comprendrez mieu > > > > > > #include "stdafx.h" > > #include "resource.h" > > #include <stdio.h> > > #include <iostream.h> > > #include <time.h> > > #include <conio.h> > > #include <istream.h> > > #pragma comment(lib, "ws2_32.lib") > > #include <winsock2.h> > > > > #define MAX_LOADSTRING 100 > > #define ID_BUTTON 100 > > #define ID_EDITBOX 100 > > > > // Global Variables: > > HINSTANCE hInst; // current instance > > TCHAR szTitle[MAX_LOADSTRING]; // The title bar text > > TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text > > > > // Foward declarations of functions included in this code module: > > ATOM MyRegisterClass(HINSTANCE hInstance); > > BOOL InitInstance(HINSTANCE, int); > > LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); > > LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); > > > > int APIENTRY WinMain(HINSTANCE hInstance, > > HINSTANCE hPrevInstance, > > LPSTR lpCmdLine, > > int nCmdShow) > > { > > // TODO: Place code here. > > MSG msg; > > HACCEL hAccelTable; > > > > // Initialize global strings > > LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); > > LoadString(hInstance, IDC_SCANNERBYSFYLER, szWindowClass, MAX_LOADSTRING); > > MyRegisterClass(hInstance); > > > > // Perform application initialization: > > if (!InitInstance (hInstance, nCmdShow)) > > { > > return FALSE; > > } > > > > hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_SCANNERBYSFYLER); > > > > // Main message loop: > > while (GetMessage(&msg, NULL, 0, 0)) > > { > > if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) > > { > > TranslateMessage(&msg); > > DispatchMessage(&msg); > > } > > } > > > > return msg.wParam; > > } > > > > > > > > // > > // FUNCTION: MyRegisterClass() > > // > > // PURPOSE: Registers the window class. > > // > > // COMMENTS: > > // > > // This function and its usage is only necessary if you want this code > > // to be compatible with Win32 systems prior to the 'RegisterClassEx' > > // function that was added to Windows 95. It is important to call this function > > // so that the application will get 'well formed' small icons associated > > // with it. > > // > > ATOM MyRegisterClass(HINSTANCE hInstance) > > { > > WNDCLASSEX wcex; > > > > wcex.cbSize = sizeof(WNDCLASSEX); > > > > wcex.style = CS_HREDRAW | CS_VREDRAW; > > wcex.lpfnWndProc = (WNDPROC)WndProc; > > wcex.cbClsExtra = 0; > > wcex.cbWndExtra = 0; > > wcex.hInstance = hInstance; > > wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_SCANNERBYSFYLER); > > wcex.hCursor = LoadCursor(NULL, IDC_ARROW); > > wcex.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); > > wcex.lpszMenuName = (LPCSTR)IDC_SCANNERBYSFYLER; > > wcex.lpszClassName = szWindowClass; > > wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL); > > > > return RegisterClassEx(&wcex); > > } > > > > // > > // FUNCTION: InitInstance(HANDLE, int) > > // > > // PURPOSE: Saves instance handle and creates main window > > // > > // COMMENTS: > > // > > // In this function, we save the instance handle in a global variable and > > // create and display the main program window. > > // > > BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) > > { > > HWND hWnd; > > > > hInst = hInstance; // Store instance handle in our global variable > > > > hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, > > CW_USEDEFAULT, CW_USEDEFAULT, 180, 250, HWND_DESKTOP, NULL, hInstance, NULL); > > HWND edithWnd = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "EDIT", "", WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL|ES_NOHIDESEL, > > 10, 10, 150, 25, hWnd, (HMENU)ID_EDITBOX, hInstance, NULL); > > SetWindowText(edithWnd, "IP"); > > > > HWND edithWnd1 = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "EDIT", "", WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL|ES_NOHIDESEL, > > 10, 50, 150, 25, hWnd, (HMENU)ID_EDITBOX, hInstance, NULL); > > SetWindowText(edithWnd1, "PORT"); > > // Création du bouton > > HWND cmdhWnd = CreateWindowEx(0, "BUTTON", "", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON|BS_NOTIFY|BS_TEXT, > > 10, 150, 150, 30, hWnd, (HMENU)ID_BUTTON, hInstance, NULL); > > SetWindowText(cmdhWnd, "Scan"); > > > > if (!hWnd) > > { > > return FALSE; > > } > > > > ShowWindow(hWnd, nCmdShow); > > UpdateWindow(hWnd); > > > > > > return TRUE; > > } > > > > // > > // FUNCTION: WndProc(HWND, unsigned, WORD, LONG) > > // > > // PURPOSE: Processes messages for the main window. > > // > > // WM_COMMAND - process the application menu > > // WM_PAINT - Paint the main window > > // WM_DESTROY - post a quit message and return > > // > > // > > LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) > > { > > int wmId, wmEvent; > > PAINTSTRUCT ps; > > HDC hdc; > > TCHAR szHello[MAX_LOADSTRING]; > > LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING); > > > > switch (message) > > { > > case WM_COMMAND: > > wmId = LOWORD(wParam); > > wmEvent = HIWORD(wParam); > > if ((LOWORD(wParam) == ID_BUTTON) && (HIWORD(wParam) == BN_CLICKED)) > > { > > MessageBox(hWnd, "Scan en cours", "Scanner", MB_OK|MB_ICONINFORMATION); > > > > WSADATA WSAData; // tout les prog de > > WSAStartup(MAKEWORD(2,0),&WSAData); > > > > SOCKET sock; > > > > SOCKADDR_IN sin; > > //ICI JAIMERAIS QUE CE SOIT LES EDIT BOX QUI REMPLISSE IP ET PORT> > sin.sin_addr.s_addr = inet_addr(IP); // definit les propriétés > > sin.sin_family = AF_INET; // de la socket > > sin.sin_port = htons(PORT); > > > > sock = socket(AF_INET,SOCK_STREAM,0); > > n = connect(sock,(SOCKADDR *)&sin,sizeof(sin)); > > if(n == 0) // si on peut se connecter (donc si le port est ouvert) > > { > > MessageBox(hWnd, "Le port est ouvert", "Scanner", MB_OK|MB_ICONINFORMATION); > > } > > else > > { > > MessageBox(hWnd, "Le port est fermé", "Scanner", MB_OK|MB_ICONINFORMATION); > > > > } > > closesocket(sock); > > WSACleanup(); > > > > > > //execution du code > > } > > // Parse the menu selections: > > switch (wmId) > > { > > case IDM_ABOUT: > > DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); > > break; > > case IDM_EXIT: > > DestroyWindow(hWnd); > > break; > > default: > > return DefWindowProc(hWnd, message, wParam, lParam); > > } > > break; > > case WM_PAINT: > > hdc = BeginPaint(hWnd, &ps); > > // TODO: Add any drawing code here... > > RECT rt; > > GetClientRect(hWnd, &rt); > > > > EndPaint(hWnd, &ps); > > break; > > > > case WM_DESTROY: > > PostQuitMessage(0); > > break; > > default: > > return DefWindowProc(hWnd, message, wParam, lParam); > > } > > return 0; > > } > > > > // Mesage handler for about box. > > LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) > > { > > switch (message) > > { > > case WM_INITDIALOG: > > return TRUE; > > > > case WM_COMMAND: > > if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) > > { > > EndDialog(hDlg, LOWORD(wParam)); > > return TRUE; > > } > > break; > > } > > return FALSE; > > } > > > > > > http://totalpcone.free.fr  >
|
|
vendredi 30 mai 2003 à 17:09:24 |
Re : PB EditBox

SfyLer
|
eeeee je rectifie la source: > char *LePORT = NULL; <----- c'est pas sa, c'est ca: char *LeText = NULL; http://totalpc.free.fr  ------------------------------- Réponse au message : ------------------------------- > merci beaucoup ! mais jai encore un blem pour le port: > char *LePORT = NULL; > unsigned int TextLen = 0; > TextLen = GetWindowTextLength(EditHandle); > LeText = new char[(TextLen + 2)]; > TextLen = GetWindowText(EditHandle, LeText, (TextLen + 1)); > > Le pb c'est que sa, sa prend ce ke ya ecri dans le edit box et sa le met dans une variable char, et je narrive pas a ce ki prennent une variable int, pouvez vous juste modifier ce code pour ke sa marche ? > http://totalpc.free.fr  > > > ------------------------------- > Réponse au message : > ------------------------------- > > > GetWindowText(hedit, szbuff, lenbuff); > > ou alors: > > GetDlgItemText(hdlg, IDED_IP, szbuff, lenbuff); > > donc si tu as char szIP[20]: > > nbrcaracs = GetWindowText(hedit, szIP, 20); > > BruNews, ciao... > > > > > > ------------------------------- > > Réponse au message : > > ------------------------------- > > > > > Bonjour à tous ! > > > J'ai créé un scanner de port sous dos, et j'ai commencer a le faire sous windows, j'ai presque fini le seul pb que j'ai c'est que je ne sait pas comment les editbox peuvent ecrire dans les variables IP et PORT. > > > Voici la source vous comprendrez mieu > > > > > > > > > #include "stdafx.h" > > > #include "resource.h" > > > #include <stdio.h> > > > #include <iostream.h> > > > #include <time.h> > > > #include <conio.h> > > > #include <istream.h> > > > #pragma comment(lib, "ws2_32.lib") > > > #include <winsock2.h> > > > > > > #define MAX_LOADSTRING 100 > > > #define ID_BUTTON 100 > > > #define ID_EDITBOX 100 > > > > > > // Global Variables: > > > HINSTANCE hInst; // current instance > > > TCHAR szTitle[MAX_LOADSTRING]; // The title bar text > > > TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text > > > > > > // Foward declarations of functions included in this code module: > > > ATOM MyRegisterClass(HINSTANCE hInstance); > > > BOOL InitInstance(HINSTANCE, int); > > > LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); > > > LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); > > > > > > int APIENTRY WinMain(HINSTANCE hInstance, > > > HINSTANCE hPrevInstance, > > > LPSTR lpCmdLine, > > > int nCmdShow) > > > { > > > // TODO: Place code here. > > > MSG msg; > > > HACCEL hAccelTable; > > > > > > // Initialize global strings > > > LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); > > > LoadString(hInstance, IDC_SCANNERBYSFYLER, szWindowClass, MAX_LOADSTRING); > > > MyRegisterClass(hInstance); > > > > > > // Perform application initialization: > > > if (!InitInstance (hInstance, nCmdShow)) > > > { > > > return FALSE; > > > } > > > > > > hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_SCANNERBYSFYLER); > > > > > > // Main message loop: > > > while (GetMessage(&msg, NULL, 0, 0)) > > > { > > > if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) > > > { > > > TranslateMessage(&msg); > > > DispatchMessage(&msg); > > > } > > > } > > > > > > return msg.wParam; > > > } > > > > > > > > > > > > // > > > // FUNCTION: MyRegisterClass() > > > // > > > // PURPOSE: Registers the window class. > > > // > > > // COMMENTS: > > > // > > > // This function and its usage is only necessary if you want this code > > > // to be compatible with Win32 systems prior to the 'RegisterClassEx' > > > // function that was added to Windows 95. It is important to call this function > > > // so that the application will get 'well formed' small icons associated > > > // with it. > > > // > > > ATOM MyRegisterClass(HINSTANCE hInstance) > > > { > > > WNDCLASSEX wcex; > > > > > > wcex.cbSize = sizeof(WNDCLASSEX); > > > > > > wcex.style = CS_HREDRAW | CS_VREDRAW; > > > wcex.lpfnWndProc = (WNDPROC)WndProc; > > > wcex.cbClsExtra = 0; > > > wcex.cbWndExtra = 0; > > > wcex.hInstance = hInstance; > > > wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_SCANNERBYSFYLER); > > > wcex.hCursor = LoadCursor(NULL, IDC_ARROW); > > > wcex.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); > > > wcex.lpszMenuName = (LPCSTR)IDC_SCANNERBYSFYLER; > > > wcex.lpszClassName = szWindowClass; > > > wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL); > > > > > > return RegisterClassEx(&wcex); > > > } > > > > > > // > > > // FUNCTION: InitInstance(HANDLE, int) > > > // > > > // PURPOSE: Saves instance handle and creates main window > > > // > > > // COMMENTS: > > > // > > > // In this function, we save the instance handle in a global variable and > > > // create and display the main program window. > > > // > > > BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) > > > { > > > HWND hWnd; > > > > > > hInst = hInstance; // Store instance handle in our global variable > > > > > > hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, > > > CW_USEDEFAULT, CW_USEDEFAULT, 180, 250, HWND_DESKTOP, NULL, hInstance, NULL); > > > HWND edithWnd = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "EDIT", "", WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL|ES_NOHIDESEL, > > > 10, 10, 150, 25, hWnd, (HMENU)ID_EDITBOX, hInstance, NULL); > > > SetWindowText(edithWnd, "IP"); > > > > > > HWND edithWnd1 = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "EDIT", "", WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL|ES_NOHIDESEL, > > > 10, 50, 150, 25, hWnd, (HMENU)ID_EDITBOX, hInstance, NULL); > > > SetWindowText(edithWnd1, "PORT"); > > > // Création du bouton > > > HWND cmdhWnd = CreateWindowEx(0, "BUTTON", "", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON|BS_NOTIFY|BS_TEXT, > > > 10, 150, 150, 30, hWnd, (HMENU)ID_BUTTON, hInstance, NULL); > > > SetWindowText(cmdhWnd, "Scan"); > > > > > > if (!hWnd) > > > { > > > return FALSE; > > > } > > > > > > ShowWindow(hWnd, nCmdShow); > > > UpdateWindow(hWnd); > > > > > > > > > return TRUE; > > > } > > > > > > // > > > // FUNCTION: WndProc(HWND, unsigned, WORD, LONG) > > > // > > > // PURPOSE: Processes messages for the main window. > > > // > > > // WM_COMMAND - process the application menu > > > // WM_PAINT - Paint the main window > > > // WM_DESTROY - post a quit message and return > > > // > > > // > > > LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) > > > { > > > int wmId, wmEvent; > > > PAINTSTRUCT ps; > > > HDC hdc; > > > TCHAR szHello[MAX_LOADSTRING]; > > > LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING); > > > > > > switch (message) > > > { > > > case WM_COMMAND: > > > wmId = LOWORD(wParam); > > > wmEvent = HIWORD(wParam); > > > if ((LOWORD(wParam) == ID_BUTTON) && (HIWORD(wParam) == BN_CLICKED)) > > > { > > > MessageBox(hWnd, "Scan en cours", "Scanner", MB_OK|MB_ICONINFORMATION); > > > > > > WSADATA WSAData; // tout les prog de > > > WSAStartup(MAKEWORD(2,0),&WSAData); > > > > > > SOCKET sock; > > > > > > SOCKADDR_IN sin; > > > //ICI JAIMERAIS QUE CE SOIT LES EDIT BOX QUI REMPLISSE IP ET PORT> > > sin.sin_addr.s_addr = inet_addr(IP); // definit les propriétés > > > sin.sin_family = AF_INET; // de la socket > > > sin.sin_port = htons(PORT); > > > > > > sock = socket(AF_INET,SOCK_STREAM,0); > > > n = connect(sock,(SOCKADDR *)&sin,sizeof(sin)); > > > if(n == 0) // si on peut se connecter (donc si le port est ouvert) > > > { > > > MessageBox(hWnd, "Le port est ouvert", "Scanner", MB_OK|MB_ICONINFORMATION); > > > } > > > else > > > { > > > MessageBox(hWnd, "Le port est fermé", "Scanner", MB_OK|MB_ICONINFORMATION); > > > > > > } > > > closesocket(sock); > > > WSACleanup(); > > > > > > > > > //execution du code > > > } > > > // Parse the menu selections: > > > switch (wmId) > > > { > > > case IDM_ABOUT: > > > DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); > > > break; > > > case IDM_EXIT: > > > DestroyWindow(hWnd); > > > break; > > > default: > > > return DefWindowProc(hWnd, message, wParam, lParam); > > > } > > > break; > > > case WM_PAINT: > > > hdc = BeginPaint(hWnd, &ps); > > > // TODO: Add any drawing code here... > > > RECT rt; > > > GetClientRect(hWnd, &rt); > > > > > > EndPaint(hWnd, &ps); > > > break; > > > > > > case WM_DESTROY: > > > PostQuitMessage(0); > > > break; > > > default: > > > return DefWindowProc(hWnd, message, wParam, lParam); > > > } > > > return 0; > > > } > > > > > > // Mesage handler for about box. > > > LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) > > > { > > > switch (message) > > > { > > > case WM_INITDIALOG: > > > return TRUE; > > > > > > case WM_COMMAND: > > > if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) > > > { > > > EndDialog(hDlg, LOWORD(wParam)); > > > return TRUE; > > > } > > > break; > > > } > > > return FALSE; > > > } > > > > > > > > > http://totalpcone.free.fr  > > >
|
|
vendredi 30 mai 2003 à 17:15:02 |
Re : PB EditBox

BruNews
|
ival = GetDlgItemInt(hdlg, IDED_IP, 0, 0); je mets 0 sur desrnier, tu mets 1 si est nbr signe. Sinon tu fais avec solution d'avant: ival = atoi(szbuff); BruNews, ciao... ------------------------------- Réponse au message : ------------------------------- > merci beaucoup ! mais jai encore un blem pour le port: > char *LePORT = NULL; > unsigned int TextLen = 0; > TextLen = GetWindowTextLength(EditHandle); > LeText = new char[(TextLen + 2)]; > TextLen = GetWindowText(EditHandle, LeText, (TextLen + 1)); > > Le pb c'est que sa, sa prend ce ke ya ecri dans le edit box et sa le met dans une variable char, et je narrive pas a ce ki prennent une variable int, pouvez vous juste modifier ce code pour ke sa marche ? > http://totalpc.free.fr  > > > ------------------------------- > Réponse au message : > ------------------------------- > > > GetWindowText(hedit, szbuff, lenbuff); > > ou alors: > > GetDlgItemText(hdlg, IDED_IP, szbuff, lenbuff); > > donc si tu as char szIP[20]: > > nbrcaracs = GetWindowText(hedit, szIP, 20); > > BruNews, ciao... > > > > > > ------------------------------- > > Réponse au message : > > ------------------------------- > > > > > Bonjour à tous ! > > > J'ai créé un scanner de port sous dos, et j'ai commencer a le faire sous windows, j'ai presque fini le seul pb que j'ai c'est que je ne sait pas comment les editbox peuvent ecrire dans les variables IP et PORT. > > > Voici la source vous comprendrez mieu > > > > > > > > > #include "stdafx.h" > > > #include "resource.h" > > > #include <stdio.h> > > > #include <iostream.h> > > > #include <time.h> > > > #include <conio.h> > > > #include <istream.h> > > > #pragma comment(lib, "ws2_32.lib") > > > #include <winsock2.h> > > > > > > #define MAX_LOADSTRING 100 > > > #define ID_BUTTON 100 > > > #define ID_EDITBOX 100 > > > > > > // Global Variables: > > > HINSTANCE hInst; // current instance > > > TCHAR szTitle[MAX_LOADSTRING]; // The title bar text > > > TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text > > > > > > // Foward declarations of functions included in this code module: > > > ATOM MyRegisterClass(HINSTANCE hInstance); > > > BOOL InitInstance(HINSTANCE, int); > > > LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); > > > LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); > > > > > > int APIENTRY WinMain(HINSTANCE hInstance, > > > HINSTANCE hPrevInstance, > > > LPSTR lpCmdLine, > > > int nCmdShow) > > > { > > > // TODO: Place code here. > > > MSG msg; > > > HACCEL hAccelTable; > > > > > > // Initialize global strings > > > LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); > > > LoadString(hInstance, IDC_SCANNERBYSFYLER, szWindowClass, MAX_LOADSTRING); > > > MyRegisterClass(hInstance); > > > > > > // Perform application initialization: > > > if (!InitInstance (hInstance, nCmdShow)) > > > { > > > return FALSE; > > > } > > > > > > hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_SCANNERBYSFYLER); > > > > > > // Main message loop: > > > while (GetMessage(&msg, NULL, 0, 0)) > > > { > > > if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) > > > { > > > TranslateMessage(&msg); > > > DispatchMessage(&msg); > > > } > > > } > > > > > > return msg.wParam; > > > } > > > > > > > > > > > > // > > > // FUNCTION: MyRegisterClass() > > > // > > > // PURPOSE: Registers the window class. > > > // > > > // COMMENTS: > > > // > > > // This function and its usage is only necessary if you want this code > > > // to be compatible with Win32 systems prior to the 'RegisterClassEx' > > > // function that was added to Windows 95. It is important to call this function > > > // so that the application will get 'well formed' small icons associated > > > // with it. > > > // > > > ATOM MyRegisterClass(HINSTANCE hInstance) > > > { > > > WNDCLASSEX wcex; > > > > > > wcex.cbSize = sizeof(WNDCLASSEX); > > > > > > wcex.style = CS_HREDRAW | CS_VREDRAW; > > > wcex.lpfnWndProc = (WNDPROC)WndProc; > > > wcex.cbClsExtra = 0; > > > wcex.cbWndExtra = 0; > > > wcex.hInstance = hInstance; > > > wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_SCANNERBYSFYLER); > > > wcex.hCursor = LoadCursor(NULL, IDC_ARROW); > > > wcex.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); > > > wcex.lpszMenuName = (LPCSTR)IDC_SCANNERBYSFYLER; > > > wcex.lpszClassName = szWindowClass; > > > wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL); > > > > > > return RegisterClassEx(&wcex); > > > } > > > > > > // > > > // FUNCTION: InitInstance(HANDLE, int) > > > // > > > // PURPOSE: Saves instance handle and creates main window > > > // > > > // COMMENTS: > > > // > > > // In this function, we save the instance handle in a global variable and > > > // create and display the main program window. > > > // > > > BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) > > > { > > > HWND hWnd; > > > > > > hInst = hInstance; // Store instance handle in our global variable > > > > > > hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, > > > CW_USEDEFAULT, CW_USEDEFAULT, 180, 250, HWND_DESKTOP, NULL, hInstance, NULL); > > > HWND edithWnd = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "EDIT", "", WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL|ES_NOHIDESEL, > > > 10, 10, 150, 25, hWnd, (HMENU)ID_EDITBOX, hInstance, NULL); > > > SetWindowText(edithWnd, "IP"); > > > > > > HWND edithWnd1 = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "EDIT", "", WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL|ES_NOHIDESEL, > > > 10, 50, 150, 25, hWnd, (HMENU)ID_EDITBOX, hInstance, NULL); > > > SetWindowText(edithWnd1, "PORT"); > > > // Création du bouton > > > HWND cmdhWnd = CreateWindowEx(0, "BUTTON", "", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON|BS_NOTIFY|BS_TEXT, > > > 10, 150, 150, 30, hWnd, (HMENU)ID_BUTTON, hInstance, NULL); > > > SetWindowText(cmdhWnd, "Scan"); > > > > > > if (!hWnd) > > > { > > > return FALSE; > > > } > > > > > > ShowWindow(hWnd, nCmdShow); > > > UpdateWindow(hWnd); > > > > > > > > > return TRUE; > > > } > > > > > > // > > > // FUNCTION: WndProc(HWND, unsigned, WORD, LONG) > > > // > > > // PURPOSE: Processes messages for the main window. > > > // > > > // WM_COMMAND - process the application menu > > > // WM_PAINT - Paint the main window > > > // WM_DESTROY - post a quit message and return > > > // > > > // > > > LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) > > > { > > > int wmId, wmEvent; > > > PAINTSTRUCT ps; > > > HDC hdc; > > > TCHAR szHello[MAX_LOADSTRING]; > > > LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING); > > > > > > switch (message) > > > { > > > case WM_COMMAND: > > > wmId = LOWORD(wParam); > > > wmEvent = HIWORD(wParam); > > > if ((LOWORD(wParam) == ID_BUTTON) && (HIWORD(wParam) == BN_CLICKED)) > > > { > > > MessageBox(hWnd, "Scan en cours", "Scanner", MB_OK|MB_ICONINFORMATION); > > > > > > WSADATA WSAData; // tout les prog de > > > WSAStartup(MAKEWORD(2,0),&WSAData); > > > > > > SOCKET sock; > > > > > > SOCKADDR_IN sin; > > > //ICI JAIMERAIS QUE CE SOIT LES EDIT BOX QUI REMPLISSE IP ET PORT> > > sin.sin_addr.s_addr = inet_addr(IP); // definit les propriétés > > > sin.sin_family = AF_INET; // de la socket > > > sin.sin_port = htons(PORT); > > > > > > sock = socket(AF_INET,SOCK_STREAM,0); > > > n = connect(sock,(SOCKADDR *)&sin,sizeof(sin)); > > > if(n == 0) // si on peut se connecter (donc si le port est ouvert) > > > { > > > MessageBox(hWnd, "Le port est ouvert", "Scanner", MB_OK|MB_ICONINFORMATION); > > > } > > > else > > > { > > > MessageBox(hWnd, "Le port est fermé", "Scanner", MB_OK|MB_ICONINFORMATION); > > > > > > } > > > closesocket(sock); > > > WSACleanup(); > > > > > > > > > //execution du code > > > } > > > // Parse the menu selections: > > > switch (wmId) > > > { > > > case IDM_ABOUT: > > > DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); > > > break; > > > case IDM_EXIT: > > > DestroyWindow(hWnd); > > > break; > > > default: > > > return DefWindowProc(hWnd, message, wParam, lParam); > > > } > > > break; > > > case WM_PAINT: > > > hdc = BeginPaint(hWnd, &ps); > > > // TODO: Add any drawing code here... > > > RECT rt; > > > GetClientRect(hWnd, &rt); > > > > > > EndPaint(hWnd, &ps); > > > break; > > > > > > case WM_DESTROY: > > > PostQuitMessage(0); > > > break; > > > default: > > > return DefWindowProc(hWnd, message, wParam, lParam); > > > } > > > return 0; > > > } > > > > > > // Mesage handler for about box. > > > LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) > > > { > > > switch (message) > > > { > > > case WM_INITDIALOG: > > > return TRUE; > > > > > > case WM_COMMAND: > > > if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) > > > { > > > EndDialog(hDlg, LOWORD(wParam)); > > > return TRUE; > > > } > > > break; > > > } > > > return FALSE; > > > } > > > > > > > > > http://totalpcone.free.fr  > > >
|
|
Cette discussion est classée dans : hwnd, wparam, return, hinstance, wcex
Répondre à ce message
Sujets en rapport avec ce message
Pb sur un ptit bout de prog en DirectX.... [ par Haldwin ]
Salut a tous....Voila j'ai deux ptits pbs quand je lance cette appli ci-dessous... (VC++)La première est q'une fois sur deux ma variable hWnd apres le
crer "dialog non modal" [ par comfm ]
BonjourJe n'arrive pas à créer une boite de dialogue non modal, c'est à dire celle qui permet d'être tjs affichée et on peut cliquer derriere sans pro
Problème de linker dans programme de base. [ par vith17 ]
Bonjour,J'ai tapé le code suivant sous Dev-C++. Lorsque je lance la compilation, il me revoie l'erreur suivante : [Linker error] undefined referenc
Je trouve pas le bon code [ par vah bi ]
Bonjour à tous , voilà je débute en c et comme editeur j'ai le visual c++.Je fais actuellement une application avec l'api de visual c++ mais en lang
WIN32 : Editbox non editable avec une boite de dialogue CHILD [ par Pistol_Pete ]
BonjourVoila mon problème: J'ai créé une fenêtre et dans cette fenêtre j'ai une boite de dialogue avec le style WS_CHILD. Tous mes contrôles de cette
Probleme de socket [ par alphaone ]
// tcp_client.cpp*: définit le point d'entrée pour l'appli
Problème graphique avec C [ par le1scorpion1noir ]
salut a tous je peux savoir c'est quoi le meilleur logiciel pour programmer en C puis y t il une différence entre le C et le C++ ? je débute et j ess
Hook WH_MOUSE_LL [ par vecchio56 ]
Bonjour,J'utilise un hook bas niveau de type WH_MOUSE_LL, et j'ai un problème lorque je cherche a fermer ma fenêtre principale (la souris se bloque).
Dialog fenetre enfant qui bloque [ par NairodDorian ]
Bonjour,Mon probleme est le suivant, j'utilises les resources avec des dialog et je voudrai affiche un dialogue defini par Child dans les proprietes d
lire un fichier wav [ par youma85 ]
salut tous le monde lorsque j'execute ce programme on me donne ses erreur#include #include #include "resource.h"HINSTANCE hInst;LRESULT CALLBACK MainP
Livres en rapport
|
Derniers Blogs
POUR RAPPEL ! LES SPéCIFICATIONS DES PROTOCOLES OFFICE ET SHAREPOINT SONT DISPONIBLES SUR MSDNPOUR RAPPEL ! LES SPéCIFICATIONS DES PROTOCOLES OFFICE ET SHAREPOINT SONT DISPONIBLES SUR MSDN par neodante
Quelle est le point commun entre : Microsoft il y a 10 ans et Apple aujourd'hui ? Réponse: avoir une politique de protocoles propriétaires et fermés :) Car pour rappel (si si je vous assure c'est important de le rappeler), la majorité des spécifications e...
Cliquez pour lire la suite de l'article par neodante JOYEUX ANNIVERSAIRE NIXJOYEUX ANNIVERSAIRE NIX par ebartsoft
Souhaitons un bon et joyeux anniversaire à notre hôte à tous, Nix.
Je ne le répéterais jamais assez mais sans lui rien ne serait possible. Il défit en permanence les lois de la gravité et comme il le dit si bien, si tu lui fais confiance ça devra...
Cliquez pour lire la suite de l'article par ebartsoft IMAGINE CUP 2012, MAKE A SIGN EN FINALEIMAGINE CUP 2012, MAKE A SIGN EN FINALE par junarnoalg
Voilà qui est fait, la nouvelle est officielle ! L'équipe belge "Make a Sign" va au pays des kangourous défendre son projet dans la catégorie Software Design. http://www.imaginecup.com/CompetitionsContent/Competition/WorldwideFinalists.aspx V...
Cliquez pour lire la suite de l'article par junarnoalg KINECT 1.5 IS OUT !KINECT 1.5 IS OUT ! par Vko
La version 1.5 du Kinect For Microsoft vient tout juste de sortir ! Plein de nouveautés: Tracking de squelette en Near Mode Détection en position assise Détection faciale avec un SDK dédié Documentation et des guideline (enfin) Un out...
Cliquez pour lire la suite de l'article par Vko LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) par richardc
Mise à jour des Web API du 14 Mai
Réservez dès maintenant votre journée du 20 juin pour le Windows Azure Dev Camp 2012 à Paris
Mise à jour de Team Foundation Service
MechCommander 2 sur Windows 8
Entity Framework 5 Release Candidate e...
Cliquez pour lire la suite de l'article par richardc
Forum
MATLAB PROGRAMME MATLAB PROGRAMME par wahab1087
Cliquez pour lire la suite par wahab1087 RGB2GRAYRGB2GRAY par musa18
Cliquez pour lire la suite par musa18
Logiciels
sDEVIS-FACTURES vlPRO (8.1.0.3)SDEVIS-FACTURES VLPRO (8.1.0.3)sDEVIS-FACTURES vlPRO a été mis au point pour les particuliers, créateurs, entrepreneurs, artisa... Cliquez pour télécharger sDEVIS-FACTURES vlPRO 974 Application Server (12.2.4.6)974 APPLICATION SERVER (12.2.4.6)Développez de puissantes applications dans un environnement de 'cloud computing', clusterisé, séc... Cliquez pour télécharger 974 Application Server vPicture (1.4.2.1)VPICTURE (1.4.2.1)Avec vPicture, hébergez vos images facilement et rapidement.
vPicture est un utilitaire simple, ... Cliquez pour télécharger vPicture Easy-Planning (2.2.1.6)EASY-PLANNING (2.2.1.6)Easy-Planning permet de créer des plannings sous la représentation de diagrammes et est adapté au... Cliquez pour télécharger Easy-Planning COM-BACKUP (2.0)COM-BACKUP (2.0)
COM-BACKUP est un logiciel de sauvegarde qui permet de planifier les sauvegardes de vos dossiers ...
Cliquez pour télécharger COM-BACKUP
|