Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Khatharr

Member Since 24 Apr 2010
Offline Last Active Private

Topics I've Started

[WinAPI] How can I set the title of my tray icon?

01 January 2015 - 11:07 PM

I'm fiddling with the tray icon stuff in Win7 and I've got it mostly working now, but I noticed something small and annoying that I'd like to fix.
 
When I click the 'Show Hidden Icons' button in the notification tray, there's a 'Customize' link that opens a window where you can configure what tray icons are hidden and which are displayed, etc. Each Icon is accompanied by a Name and a description. The description is the tooltip text, but I don't see a way to set the Name field. Currently it's just showing the name of the exe.
 
I'd like to set the Name to a custom value, as I see many of my other applications have done. I had assumed that it would be the title of the window, but apparently this is not the case.

Does anyone know how this can be set?
 
My source, for anyone interested:
 
Spoiler

Feedback on my kickstarter

08 November 2014 - 04:10 AM

Hey, I need some feedback here.

 

I know there's no pictures or videos yet.

 

https://www.kickstarter.com/projects/1723669814/1257278820?token=3d2d640e


More fun with std::regex

28 May 2014 - 09:11 AM

In Ruby I can say:

"one two buckle my shoe ".gsub(/(.*?) /) {|m| p m}

And get the expected result (each word is printed to its own line).

 

I'm trying to do the same in C++, but it's being dippy:

#include <string>
#include <regex>
#include <iostream>

using namespace std;

int main() {
  string sentence("one two buckle my shoe ");
  regex exp("(.*?) ");
  smatch words;
  regex_search(sentence, words, exp);
  for(auto word : words) {cout << "\"" << word << "\"" << endl;}
  system("pause");
  return 0;
}

It produces:

"one " //why is it not matching the whole string?
"one"

Whereas I want it to produce:

"one two buckle my shoe " //I'll discard this annoying false match one the problem is solved
"one"
"two"
"buckle"
"my"
"shoe"

Can anyone see what I'm doing wrong here?


[C++] LSP and Rule of Three

24 September 2013 - 05:10 PM

An interesting question occurred to me today.

 

In order to observe LSP, if a base class has an explicit copy ctor / assignment operator, do the derived classes all need explicit versions between themselves and the other classes? In other words, if parent Foo has an explicit copy ctor, does Bar need conversion ctors from Foo and Baz? Does Foo need conversion assignment operators for each of its derived classes?

 

I'm thinking:

Foo* a = new Foo;
Foo* b = new Bar;
Foo* c = new Baz;
*a = *b; //what happens?

Does C++ <random> lib require seeding?

19 September 2013 - 10:06 PM

I've implemented a function:

bool doesCustomerArrive(int custPerHour) {
  if(custPerHour > 60) {return true;}
  static default_random_engine generator;
  float custPerMinute = (float)custPerHour / 60;
  bernoulli_distribution distribution(custPerMinute);
  return distribution(generator);
}

Which I'm using in a simulation. I iterate custPerHour, starting from 1, and run the thing 6000 times per iteration, doing some calculations until a specific result is met. My problem is that the program is producing the exact same unusual results every time it's run, which immediately makes me think that I've either failed to seed the randomizer or else just set this up wrong. I thought this new set of random functions didn't need seeding, and I don't see anything wrong with my algorithm. Where am I screwing up here?

 

Specifically, the problem results are:

39 CPH for 100 hours = 2016 customers (expected 3900)

40 CPH for 100 hours = 1986 customers (expected 4000)

 

The results are the same every time.


PARTNERS