Can't read the IISExpress console output, background equals foreground color - console-application

When starting IISExpress from the command line, I can't read the (debugging) console output it generates.
See the attached screenshot: 1.
System info:
OS: Windows 7 Professional 64, SP1
IIS Express version: 8.0.8418.0, 32 bit (the same problem occurs with 64bit)
Invocation: start "t1" "%ProgramFiles(x86)%\IIS Express\iisexpress.exe" /config:appApplicationHost.config /trace:w
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\DefaultColor value is 0x1F
output of Console.BackgroundColor and Console.ForegroundColor: { BackgroundColor = DarkBlue, ForegroundColor = White }
What could be causing this and what needs to be done to fix it?

Finally got it working using the following Defaults colors.
Screen text: 255, 255, 255
Screen Background: 0, 0, 128
Popup Text: 128, 0, 128
Popup Background: 255, 255, 255

Related

White color in LS_COLORS with MSYS

I'm using MSYS in a Windows machine. I've configured my LS_COLORS in .profile to color the files in white and folders in green:
LS_COLORS='fi=01;37:no=00:di=01;32'
I've set the text color of the window where msys.bat will be run as green, so whatever I write in the console appears in green. This, however, makes the white color I set for the files be green instead. This means the 37 won't set a white color, but the default text color of the window instead.
Is there a way to make the input appear in green and the files listed with ls appear in white?
You'll need to set one of the colors for the window to be white, and then set LS_COLORS to use that color instead of color 7. Using 3f instead of 37 should give you color 15.
A window has 16 colors set for it, that you can see by selecting properties -> colors by right-clicking on the border. Generally color 0 is the background and color 7 is the foreground (and many programs may assume that) though that can be changed as can the actual colors of any the 16 color codes.

MFC Image List Create ILC_COLORDDB Messing up Highlight

In MFC, when I create an image list, using these flags:
m_ImageListThumb.Create(0x20, 0x20, ILC_COLORDDB | ILC_COLOR32, 0, 1);
m_ImageListThumb.Create(0x20, 0x20, ILC_COLOR32, 0, 1);
This ways shows correctly
I seem to need to use ILC_COLORDDB, otherwise sometimes highlighting an image with alpha won't show the highlighted blue at all. But my question is how to fix the blue overlay to be smooth, so it's not grainy, when using ILC_COLORDDB.
How do I fix this so ILC_COLORDDB gives a nice smooth blue highlight on click.
ILC_COLORDDB and ILC_COLOR32 are mutually exclusive, you can't use both flags. Look at their values:
#define ILC_COLORDDB 0x000000FE
#define ILC_COLOR32 0x00000020
If ILC_COLORDDB is specified the imagelist uses a bitmap created with CreateCompatibleBitmap that is compatible with the current display, so the results you get from this will vary with your current display settings.

Emscripten call to SDL_Init freezes Browser Textinput

I am currently crosscompiling a Sprite Engine under mingw.
Therefore i have 2 Questions.
The behavior of SDL is Emulated by Emscripten through the WebGL Layer.
i don't even have to link the SDL libraries when compiling with emcc.
Question is:
If i initalize my App Like this:
if(SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO) == -1)return -1;
SDL_Surface *screen= SDL_SetVideoMode(640, 480, 24, SDL_SWSURFACE);
SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 255, 0, 0));
SDL_Flip(screen);
then i am NOT able to put text into a textfield of the Browser, but i am getting the SDL_Events.
All other Browser Inputs like checkboxes or selectboxes are working.
If initialize my App like this (Emscripten works also without SDL_Init!):
SDL_Surface *screen= SDL_SetVideoMode(640, 480, 24, SDL_HWSURFACE);
SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 255, 0, 0));
SDL_Flip(screen);
then i am able to put tet into the browser textfield but i am not getting SDL_Events.
Is there a workaround to get the Browser Text Input Fields and SDL_Events working?
Question
This line of code compiled on my WIN32 System fills the screen blue
SDL_FillRect(screen,NULL, SDL_MapRGB(screen->format, 255, 0, 0));
the same line compiled with Emscripten fills the screen red.
Is there a way to switch the SDL colors in Emscripten or in the SDL headers?
From your native code, add this before the SDL_CreateWindow call:
SDL_SetHint(SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT, "#canvas");
More info here: https://wiki.libsdl.org/SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT
Emscripten, by default, captures all user events to the page. This makes sense for a fullscreen game for example. In your use case, you probably want to modify Emscripten's SDL_Init to not listen to key events, or change its receiveEvent return value.
Had the same problem. For me, doing this fixed it:
Module['doNotCaptureKeyboard'] = true;

Allegro bitmap commands return black screen

I am a beginner at allegro and c++. I am trying to use the bitmap commands. I used this simple program to test it:
#include <allegro.h>
BITMAP *red;
int main(){
allegro_init();
install_keyboard();
set_color_depth(32);
set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0);
red = load_bitmap( "frago.png", NULL);
acquire_screen();
blit(red, screen, 0, 0, 0, 0, 480, 360);
release_screen();
readkey();
destroy_bitmap(red);
return 0;
}
END_OF_MAIN();
The file "frago.png" in question is located on my desktop and is a big red rectangle. The color is supported in color depth 32. I am using Xcode 4 on a Mac. Can someone help me?
Allegro library cannot read .png files by default. You must use some other libraries/addons (libpng, zlib, loadpng). loadpng is bundled with Allegro from version 4.3.10, but you need libpng and zlib installed in your compiler.
You must use register_png_file_type() before load_bitmap().
The loadpng addon of Allegro 4.4 is included in its source code:
https://alleg.svn.sourceforge.net/svnroot/alleg/allegro/branches/4.4/addons/loadpng/
If the PNG is 8bpp image, remember to load its color palette:
PALETTE palette;
BITMAP* red = load_bitmap("frago.png", palette);
select_palette(palette);
blit(red, screen, 0, 0, 0, 0, red->w, red->h);
unselect_palette();
Anyway I think Allegro should convert your image to 32bpp automatically, try using set_color_conversion before load_bitmap() just in case:
set_color_conversion(COLORCONV_TOTAL);
Finally you could try to use load_png() function directly (replace load_bitmap with load_png).
If the program is not running in the same folder as the image, it will not find the image.
For example, if the program is running in c:\temp\MyProgram\, the image should be located in this same folder.
Also, some IDEs allow you to specify the folder that the program will run when running or debugging from the IDE, you can set this path to your desktop or copy the image to the program folder.
Another option is to specify the full image path in the load_bitmap call, but this is the worst solution in my opinion, because the program will only works when the image is exactly in this location.
Also I suggest adding a check for null:
red = load_bitmap("frago.png", NULL);
if(red == NULL)
{
printf("Cannot load frago.png\n");
return 0;
}

SetLayeredWindowAttributes not working on Windows 7

I am using SetLayeredWindowAttributer to make a particular color of layered window transparent.
This works fine on Windows XP,VISTA . But when I use the same on Windows 7 its not working.
SetLayeredWindowAttributes(hWnd, RGB(0xff,0xff,0xff), 0, LWA_COLORKEY);
When I use LWA_ALPHA then also it works.
Problem is that I am not able to make a particular color transparent in Windows 7.
The following statement works on Windows 7
SetLayeredWindowAttributes(hWnd,RGB(0xff,0xff,0xff), 100, LWA_ALPHA);
Is it possible that the rendered color values not matching the color value in SetLayeredWindowAttributes?
You should avoid using 0xff,0xff,0xff (white) with LWA_COLORKEY. Any other value should be fine (e.g. 0xff,0xff,0xfe).
For more control over your layered window I suggest you consider using UpdateLayeredWindowIndirect. I wrote an article that describes in detail how it can be used with both GDI and Direct2D.
http://msdn.microsoft.com/en-us/magazine/ee819134.aspx