Wednesday, March 20, 2019

Linux gaming machine






/*
*  Description: C Write text file demo
*/
#include <stdio.h>
#define LEN 256
int main ()
{
   FILE * fp;
   int i;
   /* open the file for writing*/
   fp = fopen ("c:\\temp\\1.txt","w");
   /* write 10 lines of text into the file stream*/
   for(i = 0; i < 10;i++){
       fwprintf (fp, L"Ћирилица Караџића Вука - This is line %d\n",i + 1);
   }
   /* close the file*/  
   fclose (fp);
   return 0;
}



https://www.geeksforgeeks.org/executing-main-in-c-behind-the-scene/

http://learningpearls.blogspot.com/2011/02/start-function-inside-c.html


DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DEBUGGER),
hWnd, (DLGPROC)aboutProc, 0);

//--------------------------------------------------------------------------
// Name: aboutProc
// Desc: About dlg proc
//--------------------------------------------------------------------------
LRESULT CALLBACK aboutProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_COMMAND:
if (LOWORD(wParam) == IDOK)
{
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}
    break;
    }
return 0;
}

HRESULT PromptForFileOpen()
{
OPENFILENAME ofn;
char buf[260];


ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hWnd;
ofn.lpstrFile = (LPSTR)buf;
ofn.lpstrFile[0] = '\0';
ofn.nMaxFile = sizeof(buf);
ofn.lpstrFilter = "All Files\0*.*\0";
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;

if (GetOpenFileName(&ofn) != 0)
{
// buf now conatains the file path
}

return TRUE;




// WinAPI stuff:
http://www.winprog.org/tutorial/




EPP:

[]

[[]]

No comments:

Post a Comment

Коментар: