windows

sprintf an LPCWSTR variable

Hello everyone. I'm trying to debug print an LPCWSTR string, but I get a problem during the sprintf push in the buffer, because it retrieve only the first character from the string. Here is the code: HANDLE WINAPI hookedCreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, ...

How to determine Windows Java installation location

I'm trying to dynamically run a .jar from a C# assembly (using Process.Start(info)). Now, from a console application I am able to just run: ProcessStartInfo info = new ProcessStartInfo("java", "-jar somerandom.jar"); In an assembly, however, I keep getting a Win32Exception of "The system cannot find the file specified" and have to cha...

Is the Windows dev environment worth the cost?

I recently made the move from Linux development to Windows development. And as much of a Linux enthusiast that I am, I have to say - C# is a beautiful language, Visual Studio is terrific, and now that I've bought myself a trackball my wrist has stopped hurting from using the mouse so much. But there's one thing I can't get past: the co...

In Windows, should I use CreateFile or fopen, portability aside?

What are the differences, and in what cases one or the other would prove superior in some way? ...

Convert void* representation of a dword to wstring

I am having dumb monday so my apologies for posting such a newbie-like question. I am using CRegKey.QueryValue to return a dword value from the registry. QueryValue writes the value into void* pData and the length into ULONG* pnBytes. Now there is a way of getting it from pData into a wstring probably via stringstream. The closest I ...

Why do ZeroMemory, etc. exist when there are memset, etc. already?

Why does ZeroMemory, and similar calls exist in the Windows API when there are memset and related calls in the C standard library already? Which ones should I call? I can guess the answer is "depends". On what? ...

Windows authentication - MVC 2 ASP.Net

Hi there Having real problems moving my app over to windows authentication. the sql error messages are to do with problems creating in the aspnetdb.mdf file. I'm wondering whether the connection string is at fault or other elements of the web.config I have windows authentication set in IIS. web.config: <?xml version="1.0"?> <!-- ...

How can I add a computer to a domain programmatically (using .NET)?

I need to write a program or script that does a few things with (or to) a server after a Windows install. Among those is adding the server to a domain. Is there a way to do this programmatically or using a script command? ...

Best free WebDAV client for Windows?

Related question: http://stackoverflow.com/questions/340567/what-is-the-best-webdav-client-for-windows The pain point for me with Windows Explorer as a WebDAV client (or as an FTP client) is that downloading large amounts of files usually results in Windows calculating transfer times and Explorer freezing. Given that, what is the best ...

Why doesn't FONTSIGNATURE reflect lfCharSet?

I'm enumerating Windows fonts like this: LOGFONTW lf = {0}; lf.lfCharSet = DEFAULT_CHARSET; lf.lfFaceName[0] = L'\0'; lf.lfPitchAndFamily = 0; ::EnumFontFamiliesEx(hdc, &lf, reinterpret_cast<FONTENUMPROCW>(FontEnumCallback), reinterpret_cast<LPARAM>(this), 0); My callback function has this sig...

Application error: fault address 0x00012afb (Expert)

Hi, I need some "light" to get a solution. Probably there are tons of things that cause this problem, but maybe somebody could help me. Scenario: a Windows server running 24/7 a PostgreSQL database and others server applications (for processing tasks on database, etc...). There are differents servers scenarios (~30), with different har...

when i start my emmbedt web server on port 8080 i get windows security alert , can i avoid it ?

is there any way to avoid this when using embedded web server in windows? i don't want users to be scare ...

How can I test Windows Error Reporting?

My company participates in Windows Error Reporting via Winqual. We'd like to add some additional data to our crash reports, using WERRegisterMemoryBlock. Obviously we'd like to make sure this is working before we ship our next version. How can we test it? Is there a way to locally preview precisely what is going to be sent? Does thi...

Controlling the USB from Windows

Hi, I know this probably is not the easiest thing to do, but I am trying to connect Microcontroller and PC using USB. I dont want to use internal USART of Microcontroller or USB to RS232 converted, its project indended to help me understand various principles. So, getting the communication done from the Microcontroller side is piece of ...

How to detect if a windows app is Tablet PC "Aware"

Does anyone know how I can determine if an application is able to accept Tablet PC input? i.e. some kind of hittest or windows message that I can send it? thanks, H ...

How to Print the contents of a textbox in C++/CLI?

I'm still learning C++ coding. I'm having troubles getting say ResultsBox->Text to printer successfully. What is the proper way to print in C++/CLI? I think im missing something simple. Ive tried multiple different routes/syntax's that ive read online/ in books. All of which got me to a dead end. Please even a rundown on the method...

Could the Print document ive built in .net cause a UriFormatException?

After adding Print Document, Dialog, and Button to my Forms app i now have UriFormatException and A first chance exception of type 'System.ComponentModel.Win32Exception' occurred in System.Drawing.dll Additional information: Access is denied Is there something wrong with the strings in my Document? Preview looks fine. but unhand...

How can I make an alt+number global hotkey in Python ?

Hey, I want to make a global hotkey, with alt+1, 2, ..., that paste some string in the clipboard. How can I do that? ...

It's there a way to reload a greasemonkey script ?

It's there a way to reload a script from greasemonkey ? For example: When I enter on some specific website, the script from the greasemonkey works correctly, but when I change the page (asp in the website I guess), the script doesn't reload to take effect... How can I solve it? ...

Finding Windows printer driver name using API

I can't seem to find an API call that returns the driver name for a Windows printer. Note that I'm not talking about the friendly name of the printer in the printer folder, I'm talking about the name of actual driver being used as shown on the "Advanced" tab when you look at the printer properties: I'm trying to detect when I'm printi...