Commit 734247b5 authored by Pavel Roskin's avatar Pavel Roskin Committed by Alexandre Julliard

Casts to (SEGPTR) removed. They did nothing anyway.

Includes added or removed where necessary. Win16 functions replaced with their Win32 counterparts. Comments added where it was impossible. CALLBACK added where necessary. Some declarations fixed. Constructs like "#if WINDOWS" corrected. Using "#ifdef __unix__" instead. DlgProc in hello3 uses EndDialog() instead of DestroyWindow(). Listbox enabled in hello3.
parent 24f5ffc6
#include <windows.h>
#include <resource.h>
#include <commdlg.h>
#include "hello3res.h"
typedef struct
{
......@@ -22,21 +20,24 @@ BOOL FileOpen(HWND hWnd)
return GetOpenFileName(&ofn);
}
BOOL CALLBACK DlgProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
LRESULT CALLBACK DlgProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch(msg)
{
case WM_INITDIALOG:
return 1;
case WM_COMMAND:
if(wParam==100)
DestroyWindow(hWnd);
return 0;
}
return 0;
switch(msg)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
switch (wParam)
{
case 100:
EndDialog(hWnd, 100);
return TRUE;
}
}
return FALSE;
}
LRESULT WndProc (HWND wnd, UINT msg, WPARAM w, LPARAM l)
LRESULT CALLBACK WndProc (HWND wnd, UINT msg, WPARAM w, LPARAM l)
{
switch (msg){
......@@ -99,7 +100,7 @@ int PASCAL WinMain (HANDLE inst, HANDLE prev, LPSTR cmdline, int show)
class.hCursor = LoadCursor (0, IDC_ARROW);
class.hbrBackground = GetStockObject (WHITE_BRUSH);
class.lpszMenuName = 0;
class.lpszClassName = (SEGPTR)className;
class.lpszClassName = className;
}
if (!RegisterClass (&class))
return FALSE;
......
......@@ -21,7 +21,6 @@ BEGIN
CONTROL "Static text", 102, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 17, 60, 39, 10
CONTROL "Edit control", 103, "EDIT", ES_LEFT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 18, 41, 44, 13
CONTROL "Radio button", 104, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE, 17, 23, 58, 12
CONTROL "Checkbox", 101, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 19, 76, 47, 12
CONTROL "", 106, "COMBOBOX", CBS_DROPDOWN | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 86, 23, 86, 85
/* CONTROL "", 106, "LISTBOX", LBS_STANDARD | LBS_DISABLENOSCROLL | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 86, 23, 86, 85 */
CONTROL "", 105, "COMBOBOX", CBS_DROPDOWN | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 86, 13, 86, 85
CONTROL "", 106, "LISTBOX", LBS_STANDARD | LBS_DISABLENOSCROLL | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 86, 33, 86, 85
END
#include <stdio.h>
#include <windows.h>
/* Win32 counterpart for CalcChildScroll16 is not implemented */
/* even in MS Visual C++ */
#include <wine/winuser16.h>
void Write (HDC dc, int x, int y, char *s)
{
......@@ -7,7 +10,7 @@ void Write (HDC dc, int x, int y, char *s)
TextOut (dc, x, y, s, strlen (s));
}
LRESULT WndProc (HWND wnd, UINT msg, WPARAM w, LPARAM l)
LRESULT CALLBACK WndProc (HWND wnd, UINT msg, WPARAM w, LPARAM l)
{
static short xChar, yChar;
static RECT rectHola;
......@@ -49,7 +52,7 @@ LRESULT WndProc (HWND wnd, UINT msg, WPARAM w, LPARAM l)
return 0l;
}
LRESULT WndProc2 (HWND wnd, UINT msg, WPARAM w, LPARAM l)
LRESULT CALLBACK WndProc2 (HWND wnd, UINT msg, WPARAM w, LPARAM l)
{
static short xChar, yChar;
static RECT rectInfo;
......@@ -113,7 +116,7 @@ int PASCAL WinMain (HANDLE inst, HANDLE prev, LPSTR cmdline, int show)
class.hCursor = LoadCursor (0, IDC_ARROW);
class.hbrBackground = GetStockObject (WHITE_BRUSH);
class.lpszMenuName = NULL;
class.lpszClassName = (SEGPTR)className;
class.lpszClassName = className;
if (!RegisterClass (&class))
return FALSE;
}
......
......@@ -3,8 +3,8 @@
HANDLE ghInstance;
long FAR PASCAL WndProc (HWND, WORD, WPARAM, LPARAM);
long FAR PASCAL ChildProc(HWND, WORD, WPARAM, LPARAM);
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK ChildProc (HWND, UINT, WPARAM, LPARAM);
int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance,
LPSTR lpszCmdParam, int nCmdShow)
......@@ -54,7 +54,7 @@ int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance,
return msg.wParam ;
}
long FAR PASCAL WndProc (HWND hwnd, WORD message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc ;
PAINTSTRUCT ps ;
......@@ -102,7 +102,7 @@ long FAR PASCAL WndProc (HWND hwnd, WORD message, WPARAM wParam, LPARAM lParam)
return DefWindowProc (hwnd, message, wParam, lParam) ;
}
long FAR PASCAL ChildProc(HWND hwnd, WORD message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK ChildProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hDC;
PAINTSTRUCT ps;
......@@ -142,7 +142,7 @@ long FAR PASCAL ChildProc(HWND hwnd, WORD message, WPARAM wParam, LPARAM lParam)
break;
hDC = BeginPaint(hwnd, &ps);
*/
MoveTo16(hDC, 0, 0);
MoveToEx(hDC, 0, 0, NULL);
LineTo(hDC, 500, 500);
EndPaint(hwnd, &ps);
break;
......
......@@ -170,7 +170,7 @@ void Idle(HDC idc)
if(!idc) ReleaseDC(HWindow,dc);
}
LRESULT ProcessAppMsg(HWND wnd,UINT msg,WPARAM w,LPARAM l)
LRESULT CALLBACK ProcessAppMsg(HWND wnd,UINT msg,WPARAM w,LPARAM l)
{
PAINTSTRUCT PaintInfo;
HDC dc;
......
......@@ -54,15 +54,9 @@
#include <float.h>
#include <time.h>
#if WINDOWS
#include <wtypes.h>
#else
#include <windef.h>
#endif
#ifdef WINDOWS
#else
#ifdef __unix__
#include <debugstr.h>
extern LPWSTR HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str );
#endif
......@@ -71,7 +65,7 @@ extern LPWSTR HEAP_strdupAtoW( HANDLE heap, DWORD flags, LPCSTR str );
static const int MAX_BUFFER = 1024;
#ifdef WINDOWS
#ifndef __unix__
char* WtoA( OLECHAR* p )
{
int i = 0;
......
......@@ -5,7 +5,8 @@
#include <stdio.h>
#include <string.h> /* for strcat() */
int WinMain(int argc,char **argv[])
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpszCmdLine, int nCmdShow)
{
char drive, root[]="C:\\", label[1002], fsname[1002];
DWORD serial, flags, filenamelen, labellen = 1000, fsnamelen = 1000;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment