Problem displaying Icon in a button in windows xp(SP2) (MFC)! - visual-c++

I had a problem in displaying icon in button along with the Text in MFC application.. after reading lot of arctilces I got a solution for that and it worked great.But when I tested my application in win xp(SP2)..it suprised me by not showing the icon..Check the below code which i used to display the icon along with a test in button..Please let me know if there are any fix for this issue..waiting for your replies
HICON addIcon = (HICON)LoadImage(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDI_ICON4),
IMAGE_ICON,0,0,LR_DEFAULTCOLOR);
SendMessageA(::GetDlgItem(m_hWnd,IDC_ADD),BM_SETIMAGE,IMAGE_ICON,(LPARAM)(DWORD)addIcon);

If you're using VS2008 (you should), use CMFCButton from the Feature Pack. It has much better support for bitmapped buttons.

I can confirm that i can't get it to work (on Win2003, my primary development machine) and a brief search on the web found many complaints but no viable answers.
My only suggestion would be to do an ownerdraw button - handling the WM_DRAWITEM message is not difficult and may resolve this issue for you across the board.
see "Native Win32 Theme aware Owner-draw Controls without MFC"

Related

VBA Ribbon validate imageMso

I'm creating a custom ribbon in Excel, and I'm using ImageMso's for icons. I downloaded the full list of Icons from Microsoft, and tried to create a menu that displays them all for me to choose, but some of them are not displaying.
Is there any way to validate if an imageMso code does not work with the current version of windows, and display a placeholder in it's place instead of a blank icon?
Thanks,
Daniel
In my experience the short answer is no, but I also haven't investigated or attempted to resolve it with any great tenacity. If it doesn't show up I will retry with a different icon.
Note that I am not an expert by any means, but have been playing around with customUI for a while.
There is a great free Add-In I found that helps with speeding up the whole process of identifying suitable icons. It's worth checking it out.
https://www.spreadsheet1.com/how-to-use-imagemso-icons-in-excel.html
Josh
PS. I hear this is particularly an issue going into the Office 2019.

VS Code keyboard layout change

I am using Visual Studio Code with English keyboard layout switched in Windows when programming, but when I am using my computer for general use I use Slovak keyboard layout. Sometimes it can get ridiculous when I switch from one to another multiple times in one minute. Is there a setting (or a plugin) that could set the keyboard layout in VS Code to English while Windows layout is still set to Slovak?
I will summarize for you the solution to this, hope it is still helpful for you or any other looking for this answer:
you have to press Ctrl+Alt+P
then in the display that will appear at the top, write the language you want in case it does not appear
once this is done, VSC will ask you to restart.
once restarted is done it should be fine.
It is the way to do it without changing windows configuration as you will see in ther similar posts.
Hope it helps

Dreamweaver Coding Hint won't go away

I've had this issue several times and usually I can just shut down the program and restart it. But this time I have a bunch of windows open and I don't want to restart Dreamweaver.
My problem is that Dreamweaver brought up a code hint, but the code hint box now won't go away. It just sits there floating in the middle of the page. It doesn't matter if I click to Preview or any other tab in Dreamweaver, it still just sits on top of everything.
I'm working on a Mac, Dreamweaver CC (cloud, fully updated). Anyone else have this problem???
This has been a HUGE PAIN for me as well! You can make the code hint disappear though by finishing out an element that is in the code hint box. For instance if the code hint box appears and you can see class in the drop down... create a <div class="xyz"> real quick and the code hit box will dissipate after you close the quotes on the class because you used an element in that box. As to why this continually happens on the Mac version I have no idea, but I hope they fix it soon!
It's a known bug since years as you can read here: https://forums.adobe.com/message/7745689
Someone suggests as a workaround to set the Coding Hint delay to 0 (as said here: https://forums.adobe.com/message/7745689#7745689) but for me, in Dreamweaver CC 2015 Windows fully updated via cloud app, this bug still occurs while I code JS files.
Awaiting for a final fix, I hope this suggestion can be useful for you on Mac. :)

Entering text in Windows 8 in C#/MonoGame app

I'm writing a WinRT game for Windows 8, in C#, using the excellent MonoGame. I've reached the part where the user has achieved a high score and needs to enter their name. This is causing me more pain than I'd anticipated so I thought I'd ask for help.
First of all, is there a simple "enter some text" function that I can call, similar to Guide.BeginShowKeyboardInput in Windows Phone 7, or the ancient InputBox command in VB? I'm using Windows.UI.Popups.MessageDialog for displaying simple dialog messages, but can't find any similar thing for requesting text from the user.
Failing that, is there a way I can easily use a little piece of XAML to present a textbox for the user to use?
If neither of these are possible, I guess I'll have to wire this all up myself... I then would plan to intercept keystrokes and display the required text on screen myself. As I don't have a physical tablet (just the simulator) I'm struggling to start with this. How can I:
Detect whether the device has a physical keyboard, so I know whether or not to display the on screen keyboard?
If there is no physical keyboard, how can I show and hide the on screen keyboard?
Some of these sound like they should be easy to answer, but I've yet to track down answers to any of them.
Many thanks!
Adam.
Hey there is such a way to do this in monogame. There is a new template that allows you to create a XAML + Game game which allows you to use the game class you a used to with the xaml bits as well. These links should get you started. The monogame team rocks.
There are the three game types listed there. You want XAML + Game there is a template for it now if you get the proper version of monogame.
https://github.com/mono/MonoGame/wiki/Windows-8-Project-Types
let me know if you need more help
This is not a cross platform solution but you could use a FlyOut and place the controls for data entry on the window. FlyOut guidelines are here and UI Controls for text input guidelines are here. I have also used MessageDialog in a MonoGame for asking the user simple questions (up to 3 options) or to get a Yes|No response. You can get details of that class here.

Recommendation for a multi-instance jquery dialog/overlay

Ok. had enough of trying out lightboxes, overlays and dialog boxes plugins. The problem is that very few of them support nested (multiple) dialog open at the same time - a typical requirement in my opinion.
I'm looking for a recommendation for a simple plugin that:
supports callsbacks for the usual onShow/onLoad... events
supports nested instances i.e. the user open a dialog, clicks a button on it, another dialog opens up while keeping the first one open in the background. In other words, it should support the closure of each instance programatically
is NOT the jquery ui dialog plugin
This came about after the big disappointment with SimpleModal's inability to support multiple modal boxes open simultaneously!!!! #EricM, why would you do that to me? why???? ;)
I have narrowed it down to jqModal and the jquery tools overlay. The usage of the latter is weird. Maybe i'm tired but i just don't get it.
So before i dive into jqModal, does anyone have any recommendation based on personal experience that will achieve what I'm trying to do?
thanks

Resources