Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
0dddc09b
Commit
0dddc09b
authored
Mar 28, 1999
by
Pavel Roskin
Committed by
Alexandre Julliard
Mar 28, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made libtest/hello3 work again, now with Windows-compatible resource
loading.
parent
2840d1b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
17 deletions
+34
-17
Makefile.in
libtest/Makefile.in
+1
-0
hello3.c
libtest/hello3.c
+31
-15
hello3res.rc
libtest/hello3res.rc
+2
-2
No files found.
libtest/Makefile.in
View file @
0dddc09b
...
...
@@ -6,6 +6,7 @@ MODULE = none
RCFLAGS
=
-w32
-h
PROGRAMS
=
expand
hello hello2 hello3 hello4 hello5 new rolex vartest volinfo
ALL_LIBS
=
$(WINELIB)
$(X_LIBS)
$(XLIB)
$(LIBS)
WRCEXTRA
=
-A
-p
$*
C_SRCS
=
\
expand.c
\
...
...
libtest/hello3.c
View file @
0dddc09b
#include <windows.h>
#include <resource.h>
#include "hello3res.h"
#include <commdlg.h>
#include "hello3res.h"
typedef
struct
{
HANDLE
hInstance
;
HWND
hMainWnd
;
HMENU
hMainMenu
;
}
GLOBALS
;
GLOBALS
Globals
;
BOOL
FileOpen
(
HWND
hWnd
)
{
...
...
@@ -34,19 +43,26 @@ LRESULT WndProc (HWND wnd, UINT msg, WPARAM w, LPARAM l)
case
WM_COMMAND
:
switch
(
w
){
case
100
:
CreateDialogIndirect
(
0
,
hello3res_DIALOG_DIADEMO
.
bytes
,
wnd
,(
WNDPROC
)
DlgProc
);
DialogBox
(
Globals
.
hInstance
,
"DIADEMO"
,
wnd
,
(
DLGPROC
)
DlgProc
);
return
0
;
case
101
:
{
BITMAPINFO
*
bm
=
(
BITMAPINFO
*
)
hello3res_BITMAP_BITDEMO
.
bytes
;
char
*
bits
=
(
char
*
)
bm
;
HDC
hdc
=
GetDC
(
wnd
);
bits
+=
bm
->
bmiHeader
.
biSize
;
bits
+=
(
1
<<
bm
->
bmiHeader
.
biBitCount
)
*
sizeof
(
RGBQUAD
);
SetDIBitsToDevice
(
hdc
,
0
,
0
,
bm
->
bmiHeader
.
biWidth
,
bm
->
bmiHeader
.
biHeight
,
0
,
0
,
0
,
bm
->
bmiHeader
.
biHeight
,
bits
,
bm
,
DIB_RGB_COLORS
);
ReleaseDC
(
wnd
,
hdc
);
HDC
hdc
,
hMemDC
;
HBITMAP
hBitmap
,
hPrevBitmap
;
BITMAP
bmp
;
hBitmap
=
LoadBitmapA
(
Globals
.
hInstance
,
"BITDEMO"
);
hdc
=
GetDC
(
wnd
);
hMemDC
=
CreateCompatibleDC
(
hdc
);
hPrevBitmap
=
SelectObject
(
hMemDC
,
hBitmap
);
GetObjectA
(
hBitmap
,
sizeof
(
BITMAP
),
&
bmp
);
BitBlt
(
hdc
,
0
,
0
,
bmp
.
bmWidth
,
bmp
.
bmHeight
,
hMemDC
,
0
,
0
,
SRCCOPY
);
SelectObject
(
hMemDC
,
hPrevBitmap
);
DeleteDC
(
hMemDC
);
ReleaseDC
(
wnd
,
hdc
);
return
0
;
}
case
102
:
...
...
@@ -67,12 +83,12 @@ LRESULT WndProc (HWND wnd, UINT msg, WPARAM w, LPARAM l)
int
PASCAL
WinMain
(
HANDLE
inst
,
HANDLE
prev
,
LPSTR
cmdline
,
int
show
)
{
HWND
wnd
;
MSG
msg
;
WNDCLASS
class
;
char
className
[]
=
"class"
;
/* To make sure className >= 0x10000 */
char
winName
[]
=
"Test app"
;
Globals
.
hInstance
=
inst
;
if
(
!
prev
){
class
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
class
.
lpfnWndProc
=
WndProc
;
...
...
@@ -88,11 +104,11 @@ int PASCAL WinMain (HANDLE inst, HANDLE prev, LPSTR cmdline, int show)
if
(
!
RegisterClass
(
&
class
))
return
FALSE
;
w
nd
=
CreateWindow
(
className
,
winName
,
WS_OVERLAPPEDWINDOW
,
Globals
.
hMainW
nd
=
CreateWindow
(
className
,
winName
,
WS_OVERLAPPEDWINDOW
,
CW_USEDEFAULT
,
0
,
CW_USEDEFAULT
,
0
,
0
,
LoadMenu
(
inst
,
"MAIN"
),
inst
,
0
);
ShowWindow
(
w
nd
,
show
);
UpdateWindow
(
w
nd
);
ShowWindow
(
Globals
.
hMainW
nd
,
show
);
UpdateWindow
(
Globals
.
hMainW
nd
);
while
(
GetMessage
(
&
msg
,
0
,
0
,
0
)){
TranslateMessage
(
&
msg
);
...
...
libtest/hello3res.rc
View file @
0dddc09b
#include
"windows.h"
#include
<windows.h>
MAIN MENU
{
...
...
@@ -9,7 +9,7 @@ MAIN MENU
}
}
/*BITDEMO BITMAP "../rc/winelogo.bmp"*/
BITDEMO BITMAP "../rc/winelogo.bmp"
DIADEMO DIALOG 20, 20, 179, 118
STYLE DS_MODALFRAME | WS_CAPTION | WS_POPUP | WS_VISIBLE | WS_SYSMENU
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment