Can't seem to open files when running C program as a replacement Windows shell
Some quick background on this baffling problem -- I'm making an arcade game that will run Windows XP as its OS. I'm trying to hide the fact that it's running Windows blacking everything out, hiding the cursor, and replacing the Windows shell with my game's executable (so there's no taskbar). I do this using gpedit.msc, Local Computer Policy >> User Config. >> Admin. Templates >> System >> Custom User Interface, and specifying my game's EXE as the custom user interface program. This is just what some do when making MAME arcades, specifying a front end that loads instead of Explorer.exe. l The problem I'm encountering is that my program is unable to open files when it's setup to run as a custom user interface/shell. When a data file is attempted to be opened by my program, fopen returns NULL every time. However, after this happens, if I start task manager and run the same program manually as a new task, files are able to open just fine. In addition, if instead of using my program as a custom user interface, I instead specify a batch file that runs my program, then the program is able to open files just fine. I'd prefer not to go that route as then the command prompt appears and it's obvious it's a Windows box. I even tried hiding that command prompt using scripting and that didn't work.
To troubleshoot this further I wrote a program just using st开发者_如何学Godio (and not my game library, to isolate this) to simply open a text file that exists and report whether it was successful in opening the file or not. When run as a custom user interface it cannot open the file, but once logged in and manually run, it can open the file just fine! Any help on what I'm missing would be GREATLY appreciated! Thanks!
精彩评论