need code example of win32 file open dialog use

842 byte By Mike Pliam at 2007-11-17 17:50:47
I have searched dev-archive for Win32 use of the common dialog File Open. Several responses to similar questions dismissed the question by suggesting the 'querist' consult MSDN pages. This is liking asking your druggest where the dental floss is and being told to go get a root canal.I ne...

New Forum

161 byte By Brad Jones at 2007-11-18 0:19:47
A number of people have asked for a Windows API specific forum for C++ programmers. I've created this forum to answer those requests. <br/>Brad! Jones

Loading Dialog in a DLL

747 byte By TaLF at 2007-11-18 0:20:13
Hi, I did a DLL and it's a shell extension for the context menu of Explorer. Everything works perfect, but I can't show my dialog resources (this dialog is compiled into the dll).When I load a string resource like this:CComModule _Module;LoadString(_Module.GetModuleInstance(), IDS_STRING,...

WideChar / MultiByte

212 byte By Bengi at 2007-11-18 0:20:38
heya,<br/>someone have examples of using these APIs: ?<br/>WideCharToMultiByte()<br/>MultiByteToWideChar ()<br/>since its an WinAPI section, i am not expecting C++ stuff :)<br/>thn x in advance.<br/>Ben

SHAppBarMessage

757 byte By petweg at 2007-11-18 0:21:07
Hi,has anybody experience with SHAppBarMessage? I try to set auto-hide property of my taskbar to TRUE:APPBARDATA abd;abd.cbSize=sizeof(abd);abd.hWnd=FindWindow("Shell_TrayWnd", NULL);abd.uEdge=ABE_BOTTOM;abd.lParam=TRUE;UINT ret=0;ret=SHAppBarMessage(ABM_SETAUTOHIDEBAR,&abd); ret=SHAppBarMessage(ABM...

Close pop-up menu

114 byte By comrade64 at 2007-11-18 0:22:11
Is there any way to programmatically close an opened pop-up menu that was invoked with an API like TrackPopupMenu?

Whats the diff. between API func and API sub?

726 byte By mikledet at 2007-11-18 0:22:31
Hi All,Through the API viewer, one can see - API function decleration, and API sub's declerations...In VB I found this on MSDN about the differnace between function and sub routine:quote:------------------------A Sub procedure differs from a Function procedure in that a Sub procedure cannot be...

Accessing LPT port in Win2K

494 byte By sh_roohani at 2007-11-18 0:23:36
Hi,Accessing LPT port in Windows 2000 raises the exception Privileged instruction up. I have used an instruction _outp(0x378, 0x01) to do this. Microsoft asserts that this is a CPU privileged instruction that could not be performed in user-mode applications in NT 4.0(MSDN Library - January 2001).Is...

Do threads encapsulate functions?

1617 byte By Gyannea at 2007-11-18 0:24:19
Hello World!I had hoped to create a radio scanner object which when created would create its own window, callback function, and thread in which to execute. A main control would then oversee several scanners each controlling a receiver.Alas, there are difficulties doing that since callback functions...

openning/closing the com port

315 byte By gadi at 2007-11-18 0:25:15
I m trying to write a protocol for rf Tx & Rx . Do anyone has any idea for massage to open/close the serial port automaticly?I got lot of noise at the end of trannsimition. basicly my problem is to get read of garbage - how can i close the port (mark the end of masssage ?) without getting the gar...

Checked background

139 byte By comrade64 at 2007-11-18 0:25:20
Hi.<br/>How would I go about drawing background Windows uses for checked (pressed) buttons on toolbars? I've attached screenshot.

Schedule API?

290 byte By fenglimin at 2007-11-18 0:26:28
Hi,<br/> I want to run a piece of code at the specific time, could you tell me whether the windows schedule API can do this? I have checked the MSDN, it seemed that the windows schedule API can only schedule a program ( such as a .exe file ). Am i right? How can i do?<br/>Thanks!!

About Ws_tabstop

203 byte By goodboyws at 2007-11-18 0:26:43
MSDNKB:Windows Development<br/>BUG: Win32s 1.25a Bug List <br/> <br/>.....<br/>When WS_TABSTOP is passed to CreateWindow(), this forces a WS_MAXIMIZEBOX.<br/>.....<br/>how to resolve this problem???

Allocating a big amount of memory from driver

614 byte By sisadmin at 2007-11-18 0:26:45
Hi.I want to create a ramdisk driver that will be able to allocate upto 1 Gb of mem. (I have 4 Gb machine).BUT, Win 2000 has only 256 Mb for non-pageable pool and 470 MB limit for pageable memory pool. I haven't found any information about these values in XP .I've found the /maxmem=N optio...

Top-Level Menu Item Data

375 byte By comrade64 at 2007-11-18 0:27:20
Hi. I am using GetMenuItemInfo to retrieve information about menu items. I am using MENUITEMINFO.fMask = MIIM_DATA | MIIM_SUBMENU; and it retrieves the DATA (application-defined custom data) just fine for submenus, but not for top-level dropdown menus! But when Windows sends me WM_DRAWITEM, it fills...

LogonUser

363 byte By penina at 2007-11-18 0:27:42
I want to run an exe as a different user.LogonUser fails because the Process that runs it does nothave SE_TCB_NAME privilege.How do I set this privilege? (through code, and/or through windows tools? - I have Windows 2000).Is there a different way to program "Run As..." option?Any information will be...

Problems with extended file I/O API

767 byte By sh_roohani at 2007-11-18 0:27:58
Hi,Extended file I/O API like CopyFileEx and GetFileSizeEx are recognized as Undeclared Identifier by VC++ 6.0 on Windows 2000 Pro, while inside MSDN I saw these functions to be usable on Win NT 4.0+. I have Service Pack 3.0 On my Windows 2000 and Service Pack 4.0 On My Visual Studio 6.0.What could...

"PeekNamedPipe" fails with "ERROR_FILE_NOT_FOUND"

1035 byte By kdtripathi at 2007-11-18 0:28:39
I have a Pipe Server Windows Service, which starts a new thread for every incoming connection and hits specified URL with incoming data being passed to URL as query string. It collects back response from URL and writes it out to pipe connection. From my application when I connect to pipe server and...

need help declaring Createfile

1003 byte By ChickenLover at 2007-11-18 0:30:35
i've done this in in VB and now I need to do in VC.I'm new to Visual C and I just want to share memory with prebuilt c code when it runs. I cant figure out the security structure stuff.Can some one whip up an example so I call this function from C?thanksvb:Declare Function CreateFile Lib "...

Executable finding out its own filename/location

1198 byte By Tim the Furnish at 2007-11-18 0:32:35
Hi -Coming close to finishing an adventure game for Win32, now fiddling with making autorun stuff for the CD version. Got it all working properly - stick the CD in and it launches a program to automatically check whether game's been installed already. If not, it launches the installer found in...

Type of Objects

134 byte By Bengi at 2007-11-18 0:32:39
what kinda of object can be deleted using the DeleteObject() ?<br/>i nkow HBITMAP is one of them, is there a list of all object types?

Here is an example of dynamicly resize controls on a dialog

487 byte By Roeltje at 2007-11-18 0:32:46
I hope you all like it.In delphi you can set where controls should be anchored on.I wrote my own .cpp which allows you the same. Just call 2 simple functions and for each control you want other then "default" give on which side it must be anchored on.Never have to care about placing / moving your co...

GetPrivateProfileString()

196 byte By fleck at 2007-11-18 0:34:06
hey, how can i detect if a GetPrivateProfileString() fails, i want to know if a section exists or not, i searched msdn, but didn' t get it, a failure value isn' t mentioned there, thanks

Help! VC++ 6.0 wont allow type cast from function ptr to DWORD

1591 byte By tbchambe at 2007-11-18 0:34:13
I am trying to play wave audio data blocks with the low-level functions provided by Windows and declared in <mmsystem.h>. My problem is I can't get the compiler to allow the type cast from the Wave callback function pointer to DWORD, which the waveOutOpen() function expects for parameter...

API and their H files

476 byte By mikledet at 2007-11-18 0:34:50
Hi All,Since many API functions are wraped in MFC, I suppose, that the API include files are included through the MFC H files - maybe also in the precompiled afx includes?Could some one confirm or deny this?If this is correct - could you explain the general "mechanics" of how the API H files are inc...

How to retrieve resource associated a running process?

255 byte By main at 2007-11-18 0:35:06
hi all, how to get resources associated a running progress, such as socket , shared memory ans so on.....<br/>by the way, i'd like to ask another question:<br/>how to get the cpu and memory occupation of a running process?<br/>thank you ...

what error happen?

1355 byte By hjc at 2007-11-18 0:35:34
i write the program,link ws2_32.lib and link success,but run it can not work right.i trace it ,find gethostname function can not return right namecan somebody help me?thanksprogram:#include <stdlib.h>#include <stdio.h>#include <winsock2.h>unsigned long CalcLocalIP(){ struct hosten...

Keyboard redirection

2289 byte By omri at 2007-11-18 0:35:48
HiI have a program that redirects keyboard inputs by using low level keyboard procedure hook.This hook is installed by calling SetWindowsHookEx(WH_KEYBOARD_LL,,,).The procedure calls PostMessage to send keyboard KEYDOWN and KEYUP inputs to a window.The problem is that when running the program on Win...

Windows without title bar

1216 byte By Gyannea at 2007-11-18 0:36:44
Can anyone tell me how to modify hbutton = CreateWindow( /* Function returns the handle to the window */// WS_EX_OVERLAPPEDWINDOW, /* Extended style options */ "BUTTON", /* String with the name of the window class */ "F2", /* title of window */...

Handling Scroll Bar Messages

454 byte By joeh1001 at 2007-11-18 0:37:47
How do I handle Messages to a scroll bar control? I have added 2 horizontal scroll bar controls to my parent window using createwindowex "scrollbar". How do i handle/receive messages from them. How do I identify them seperately? I'm new to c++ but I do know how to receive and process messag...

Creating dockable windows without MFC

126 byte By mhaskar at 2007-11-18 0:38:27
Can anyone help me out, how to create dockable windows without using MFC. A sample code would be appreciated. <br/>Thanks

Keyboard to Button presses

1067 byte By Gyannea at 2007-11-18 0:38:46
I understand that Windows is a mouse-oriented system, but given that my application is to be run in a shipboard environment and potentially rough conditions it is mandatory that functionality is directed toward the keyboard.So what I would like to do is display a series of push button windows that &...

Execption on Threads - HELP ME

1286 byte By kadarb at 2007-11-18 0:38:59
I have an application which runs the following routines.1. RunThreads Is activated whenever start button is pressed. It activates 3 threads. One of them is "TCPIPThreadFunc". Once in a while I have protection error in the second line of "TCPIPThreadFunc" thread because "pTheApp->m_pMainWnd" is g...

hi

284 byte By sarkbrain at 2007-11-18 0:39:01
can somebody tell me a very good location from where I could read/download some cool books about WinAPI. i know just some MFC , but i am smart (my IQ is 186) and i am learning very fast. But you see I whana go deaper... and deaper... starting from 0 and going directly to sky!<br/>SO?

i have a question,can u help me?

417 byte By jasie24 at 2007-11-18 0:39:28
Is it possible to compile and run ,a program in C language ,in developer studio of Visual C++6?if yes ,how?i've compiled(CTRL+F7) the code ,with no errors but when i've pressed the MAKE button(F7) it gives me 2 errors:LNK2001... somethin' like that.what is the problem? i have to set s...

do you have Win98 DDK and Win NT/2000/XP DDK?

686 byte By iq0 at 2007-11-18 0:39:30
hi there and first i want to wish you a happy new year !so here goes my problem...i'm developing a program , and i need to read some data from adress 0xfe000 for a protection scheme...in win 98 is ok, but in nt/2000/xp that is not so good...i know what you will say : build a driver, etc etc...b...

A hooked dll, how to the entrypoint?

2399 byte By ngc7000 at 2007-11-18 0:39:31
hello everybody,i loaded up a dll into a process by apihook.in the dll is the dllmain() funktion call to initialise it.but the process normaly calls a custom entrypointand not dllmain to register the dll to the process.how do i call this custom funktion, which is seatedin a other dll from my dll. it...

scrollbar control messages

345 byte By joeh1001 at 2007-11-18 0:39:42
case WM_HSCROLL: BOOL GetScrollBarInfo(HWND hwnd, // handle to window or to scroll bar??LONG idObject, // scroll bar object... I don't know what this is?PSCROLLBARINFO psbi // how do i use this?);break;Help I'm new to c++ and windows APIThanks,Joe...

Big problem....

397 byte By sarkbrain at 2007-11-18 0:40:42
Hi to all , let's make the things easy:If you open Internet Explorer and select --> View --> Explorer Bars, you will see there all kind of Explorer Bars. Select History or Click CTRL + H. Well know I whana do someting like that on my own, but the problem is this: I whana users to be able...

Is there any method to get a free port number to listen on the local machine

787 byte By Speed at 2007-11-18 0:43:10
I'm going to write a FTP server. It should always listening on any randomport if free for PASV mode. Is there any method to get one free port numberto listen on?I've thought of a silly-method like that:short GetFreePortToListen(){ sockaddr_in sin; short port = 2000; sin.sin_family...

copy a directory

366 byte By phreeezsix at 2007-11-18 0:43:29
Hi, I really need to copy a directory in my program, and I have found at least 20 examples of how to do this, but every single one uses MFC. I am using a Borland compiler, so I need to do it using the standard win32 API. If anyone has an example, knows of a site to visit, or can point me in the righ...

why this code gives me an error....?

2877 byte By jasie24 at 2007-11-18 0:43:35
Why this simple program gives me a protection fault error?(it does what i want,but in the same time it appears that error..)it is written in borlandc 3.1 for windows but ,it's strange that another almost same program with this ,but it has something in adition,so it's larger ,and that work...

how can i...?

334 byte By jasie24 at 2007-11-18 0:43:36
how can i include resource files(.rc) , .def files to my source file .cin borlandc 3.1 for windows.it's strange i do not have an option like new project...ONLY open project!!!! how is that possible and why?how can i open a project if i can create him?!maybe some one knows more about this things...

Question of overdue header & library files in VC6

1782 byte By Speed at 2007-11-18 0:43:53
Header files(.h) and Library files(.lib) released with Visual C++ 6 was last updated in 1998.But it do not support of my using some new features in Windows 2000 or XP. Such as NotifyIcon Ballon Tooltips.The New-release Visual Studio .NET attached with newer header and library files. I've though...

Determine the file system programmatically

234 byte By abhinarulkar at 2007-11-18 0:45:48
Hi All,<br/> I need to know a way to programmatically know how we can determine the file system on the system disk. Is there any API available which can be used to determine the file system.<br/>Thanks and regards,<br/>Abhishek.

how to use bstr in C++

199 byte By roboguru at 2007-11-18 0:46:21
please assist how to use BSTR in C++.<br/>this is what i what i want to do <br/>struct _data<br/>{<br/>BSTR pName;<br/>short Age;<br/>};<br/>And be able to use _data in both VB and C++

DNS Server

236 byte By sriniviji at 2007-11-18 0:46:33
I want to use my own DNS server in my Windows 2000.<br/>I want to update the DNS record with latest dynamic IP address using DnsModifyRecordsInSet function.<br/>Can anyone share source code/information with me?<br/>Thanks<br/>Srini

detecting printers

304 byte By Mark Redlon at 2007-11-18 0:46:34
I am trying to get a list of all the installed printers on a user's computer without using the printer dialog. I can get all the locally installed printers and I can get all available printers on the network. I want to avoid using the dialog so the user can't change print options. Any id...

COM Port: ERROR_INVALID_HANDLE

1796 byte By greg francois at 2007-11-18 0:47:12
Dear All,I'm trying to modify the setting sfor my modem com port. Once I made the connection using TAPI, I access the settings for my com port. Getting the settings works like a charm, but when I try to set them, I get ERROR_INVALID_HANDLE from GetLastError().Any insight would be greatly apprec...

setting Baud Rates

254 byte By gadi at 2007-11-18 0:48:15
As i understood the Baud Rate of serial Data is determined by :<br/>1.8432MHz/ Divisor*16 so that how we get the following vals.:<br/>110,300,600,1200,2400... but as i see (checked on scope ) i can send Data with other baud Rates WHY?<br/>PLZ its Urgent!