All pastes #68503 Raw Edit

Something

public text v1 · immutable
#68503 ·published 2006-06-21 18:05 UTC
rendered paste body
#include <windows.h>
#define IDC_NAME     101
#define IDC_SERIAL   102


HWND edit_box, edit_box2;
HFONT edit_font;

void Generate(HWND hWnd)
{
 }

LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
        case WM_CREATE:
                    {
                    edit_box=CreateWindowEx(WS_EX_CLIENTEDGE,"edit","",WS_BORDER|WS_CHILD|WS_VISIBLE,45,40,280,25,hwnd,(HMENU)IDC_NAME,GetModuleHandle(0),0);
                    edit_font=CreateFont(8,8,0,0,1,0,0,0,0,0,0,0,0,"MS Sans Serif");
		
                    edit_box2=CreateWindowEx(WS_EX_CLIENTEDGE,"edit","",ES_AUTOHSCROLL|WS_BORDER|WS_CHILD|WS_VISIBLE|ES_READONLY,45,80,280,25,hwnd,(HMENU)IDC_SERIAL,GetModuleHandle(0),0);
                    edit_font=CreateFont(8,8,0,0,1,0,0,0,0,0,0,0,0,"MS Sans Serif");
                    
                      
                    SendMessage(edit_box,WM_SETFONT,(WPARAM)edit_font,0);
	                SendMessage(edit_box2,WM_SETFONT,(WPARAM)edit_font,0);
                    }
                    break;
                    
                    case WM_COMMAND:
                    {
                         switch(LOWORD(wParam))
                         {
                            case IDC_NAME:
                                 {
                                  Generate(hwnd);
                                  }
                                  break;
                            }
                    }
                    break;
        case WM_CLOSE:
            DestroyWindow(hwnd);
        break;
        case WM_DESTROY:
            PostQuitMessage(0);
        break;
        default:
            return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil)
{
  
	 


	MSG msg; WNDCLASSEX wincl;
  wincl.hInstance     = hInstance;
  wincl.lpszClassName = "Win32App";
  wincl.lpfnWndProc   = WindowProcedure;
  wincl.style         = CS_DBLCLKS;
  wincl.cbSize        = sizeof(WNDCLASSEX);
  wincl.hIcon         = wincl.hIconSm = LoadIcon(0, 0);
  wincl.hCursor       = LoadCursor(0, IDC_ARROW);
  wincl.lpszMenuName  = 0;
  wincl.cbClsExtra    = wincl.cbWndExtra = 0;
  wincl.hbrBackground = CreateSolidBrush(RGB(0,0,0));
   
  if(!RegisterClassEx(&wincl))
    return 0;
 

        
HWND hwnd=CreateWindowEx(0,wincl.lpszClassName,"Keygen", WS_OVERLAPPEDWINDOW | CW_USEDEFAULT | CW_USEDEFAULT  | WS_VISIBLE|WS_POPUP    
,500,500,380,280,HWND_DESKTOP,0,hInstance,0);

 
  if(!hwnd)
    return 0;
 
  while(GetMessage(&msg,0,0,0)){
    TranslateMessage(&msg);
    DispatchMessage(&msg);
  } return (int)msg.wParam;
  
}