source: trunk/testapp/console/file/stdin.c@ 22054

Last change on this file since 22054 was 22054, checked in by dmik, 13 years ago

testapp: Add stdin example.

  • Property svn:eol-style set to native
File size: 764 bytes
Line 
1#include <stdio.h>
2#include <windows.h>
3#include <tchar.h>
4
5#ifndef _MSC_VER
6
7#include <odinlx.h>
8
9int _main();
10int _argc;
11char **_argv;
12
13int WIN32API WinMain(HANDLE hInstance,
14 HANDLE hPrevInstance,
15 LPSTR lpCmdLine,
16 int nCmdShow)
17{
18 return _main(_argc, _argv);
19}
20
21int main(int argc, char **argv)
22{
23 _argc = argc;
24 _argv = argv;
25#ifdef ODIN_FORCE_WIN32_TIB
26 ForceWin32TIB();
27#endif
28 RegisterLxExe(WinMain, NULL);
29}
30
31#else
32#define _main main
33#endif
34
35int _main(int argc, char **argv)
36{
37 HANDLE h = GetStdHandle(STD_INPUT_HANDLE);
38 printf("STD_INPUT_HANDLE %x = %x\n", STD_INPUT_HANDLE, h);
39
40 DWORD type = GetFileType(h);
41 printf("handle type %d\n", type);
42
43 return 0;
44}
Note: See TracBrowser for help on using the repository browser.