technoboardLogo

Willkommen, Gast ( Anmelden | Registrierung )

> Probleme beim starten eines Programmes, visual C- source code? kein schimma
Phatline
Beitrag 12 Dec 2006, 19:37
Beitrag #1


Auf 185 gaaas mocht spaaas
********

Gruppe: Members
Beiträge: 4.206
Mitglied seit: 25-October 04
Wohnort: LINZ
Mitglieds-Nr.: 4.777



Hab das schon in einem anderen Tread gepostet,

es geht um mehrere PC-Mäuse die man gleichzeitig getrennt benutzen kann
Habe ein Programm, oder eine Sourccode? gefunden unter: dem link hier

Das Ganze sitzt in einem Ordner - (Bild anhang), es gibt keine *.exe datei, aber man kann eine *.C datei aufmachen

hab das file mit Microsoft visual C aufgemacht:



Ähm kann damit wer was anfangen? (visual c++....) wie kann man daraus ne EXE machen?

/****************************************************************************\
* *
* First.c *
* *
* This is the first Fastgraph for Windows example program. It demonstrates *
* tasks common to most Fastgraph for Windows programs and serves as a *
* template for building the other examples. *
* *
\***************************************************************************
*/

#include <windows.h>
#include <hapi.h>
#include <string.h>
#include <stdio.h>

LRESULT CALLBACK WindowProc(HWND,UINT,WPARAM,LPARAM);

char message[100];

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdParam, int iCmdShow) {
static char szAppName[] = "Mouse Test";
HWND root;
MSG msg;
WNDCLASSEX wndclass;
int i;
HBITMAP cursors[2];
hPOINT hotspots[2];
int count = 0;

wndclass.cbSize = sizeof(wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wndclass.lpfnWndProc = WindowProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(NULL,IDI_APPLICATION);
wndclass.hCursor = LoadCursor(NULL,IDC_ARROW);
wndclass.hbrBackground = NULL;
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szAppName;
wndclass.hIconSm = LoadIcon(NULL,IDI_APPLICATION);
RegisterClassEx(&wndclass);
root = CreateWindow(szAppName, // window class name
"CPNMouse for ordinary Windows applications", // window caption
(WS_OVERLAPPEDWINDOW | WS_ICONIC) & (~(WS_MAXIMIZEBOX | WS_THICKFRAME)), // window style
CW_USEDEFAULT, // initial x position
CW_USEDEFAULT, // initial y position
300, // initial x size
80, // initial y size
NULL, // parent window handle
NULL, // window menu handle
hInstance, // program instance handle
NULL); // creation parameters
ShowWindow(root,iCmdShow);

count = hInitialise(0, root, GetDC(NULL), BUTTON | MOVEMENT | CURSOR | CLIP | ACCELERATE);

sprintf(message, "I found %i mice using CPNMouse driver", count);

cursors[0] = LoadBitmap(hInstance, (LPCSTR) 20000);
cursors[1] = LoadBitmap(hInstance, (LPCSTR) 20001);

hotspots[0].x = 0;
hotspots[0].y = 0;
hotspots[1].x = 17;
hotspots[1].y = 0;

for (i = 0; i < count; ++i) {
if (i/2 == 0)
hSetCursor(i + 1, hotspots[i % 2], cursors[i % 2], 255, 0, 0);
if (i/2 == 1)
hSetCursor(i + 1, hotspots[i % 2], cursors[i % 2], 0, 255, 0);
if (i/2 == 2)
hSetCursor(i + 1, hotspots[i % 2], cursors[i % 2], 0, 0, 255);
if (i/2 >= 3)
hSetCursor(i + 1, hotspots[i % 2], cursors[i % 2], 0, 0, 0);
}

UpdateWindow(root);
while (GetMessage(&msg,NULL,0,0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}

/* CPNMOUSE
* Give the mice back to Windows. This is also done automatically when
* the application exits (even when it crashes) */
hCleanup();

return msg.wParam;
}

/****************************************************************************\
* *
* WindowProc *
* *
* Window procedure to handle messages sent to the window. *
* *
\***************************************************************************
*/
HDC hDC;
RECT rectangle;
LRESULT CALLBACK WindowProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam) {
PAINTSTRUCT ps;
RECT text;
hPOINT p;
int i;

switch (iMsg) {
case WM_CREATE:
hDC = GetDC(hWnd);
return 0;
case WM_PAINT:
BeginPaint(hWnd,&ps);
text.right = rectangle.right;
text.bottom = 40;
text.left = 20;
text.top = 20;
FillRect(hDC, &rectangle, (HBRUSH) (COLOR_WINDOW + 1));
DrawText(hDC, message, -1, &text, DT_END_ELLIPSIS);
EndPaint(hWnd,&ps);
return 0;
case WM_SETFOCUS:
InvalidateRect(hWnd,NULL,TRUE);
return 0;
case WM_SIZE:
rectangle.right = LOWORD(lParam);
rectangle.bottom = HIWORD(lParam);
return 0;
case WM_DESTROY:
ReleaseDC(hWnd,hDC);
PostQuitMessage(0);
return 0;
case (WM_USER + 1001):
hGetAbsolutePosition(HIBYTE(HIWORD(wParam)), &p);
SetCursorPos(p.x, p.y);
if (LOWORD(wParam) != 0)
mouse_event(((LOWORD(wParam)) << 1), 0, 0, 0, 0);
return 0;
}

return DefWindowProc(hWnd,iMsg,wParam,lParam);
}


Kennt sich da wer aus- wie macht man da ne Exe drauß
Angehängte Vorschaubilder
Angehängtes Bild
 
Go to the top of the page
 
+Quote Post

Beiträge in diesem Thema

« Vorhergehendes Thema · Computer, Hardware & Software · Folgendes Thema »
 
Bookmark and Share

Reply to this topicStart new topic
2 Besucher lesen dieses Thema (Gäste: 2 | Anonyme Besucher: 0)
0 Mitglieder:

 

- Vereinfachte Darstellung Aktuelles Datum: 19. May 2024 - 20:01


Copyright 2001 - 2014 technoboard.at
Die Texte geben die Meinung der Autoren und nicht unbedingt die des technoboard.at Teams wieder.
Alle fraglichen Inhalte werden auf Anfrage und alle gegen die BoardRegeln verstossenden Einträge automatisch entfernt (sobald sie bemerkt werden).
Kontakt: [email protected]

connected by: