Tag: windows

Entries for tag "windows", ordered from most recent. Entry count: 52.

Warning! Some information on this page is older than 6 years now. I keep it for reference, but it probably doesn't reflect my current knowledge and beliefs.

Pages: > 1 2 3 4 5 ... 7 >

# Upgrade to Windows 10 - My Story

Wed
20
Jul 2016

I upgraded my system to Windows 10. Free upgrade is avaiable until July 28th for all genuine users of Windows 7, 8 and 8.1, so now it's high time to do it if you don't want to pay for it later. My upgrade went well, but not without problems. Here is my story:

First some basic information:

On my old Toshiba laptop with Windows 7, bought in 2011, the upgrade failed. The system is not broken though - Windows 7 still works. After the failure I checked manufacturer's website and found that there are no drivers for this model for any operating system newer than Windows 7, so it's good to stay this way.

On my new Lenovo laptop with Windows 8.1, bought in 2015, I was able to successfully perform the upgrade suggested by the system. All the devices work correctly. All installed programs and settings are also preserved.

On my PC, with most components bought in 2013, upgrade to Windows 10 also failed. I can remember fighting with this annoying upgrade window and deleting some system files few months ago, so that might be the reason. I was ready to format my system disk and install everything from scratch anyway, so here is what I did:

  1. I made all necessary backups - an obvious step :)
  2. I launched "MediaCreationTool.exe", selected "Create installation media for another PC" and created a DVD ISO file with offline installer.
  3. I burned the file to a DVD disk.
  4. I booted my PC from Windows 7 installation DVD, formatted my system disk and installed fresh Windows 7 on it, with proper product key.
  5. I launched "MediaCreationTool.exe" and performed upgrade to Windows 10. It succeeded this time.
  6. I launched ProduKey and written down the new product key of my upgraded Windows 10.
  7. I booted my PC from Windows 10 installation DVD, formatted my system disk again and installed fresh Windows 10, with the new product key.
  8. Finally I could install all the needed apps, apply my preferred settings, set some nice wallpaper etc. (I especially recommend Mandelbulb Maniaces Facebook group as a source of wallpapers :)

I could find drivers for Windows 10 for all my components and peripherals and they all work correctly (except only an old, little webcam - ModeCom MC-1.3M, but I don't use it anyway). I could also install all the programs that I need and they seem to work.

I recommend you to also get your free upgrade to Windows 10. I had an opportunity to work with this system a lot and I could say it's not that bad :) I know there are some arguments against the new Windows version, so let's look at them:

  1. Privacy concerns. They say that Microsoft introduced telemetry code that is spying on its users and sending everything to Microsoft. That might be true, but:
    • There are ways to disable or at least minimize it - just search for "windows 10 disable telemetry".
    • Microsoft introduced telemetry to Windows 7 and 8 as well, and even to programs compiled using Visual Studio 2015.
    • Whether we like it or not (and I don't like it either), technology world evolves in the direction where our data is moved to the cloud and so corporations and governments are spying on us. It's impossible to avoid, unless you want to be an outsider using only free software and give up on all the goodness that is available to us, like smartphones.
  2. New user interface is flat and ugly. I agree with that. There are even leaks from Microsoft that explain why it looks this way. But only the new part of the system (like Settings window) are made in this new style. All other windows and apps have similar looks as they had before.
  3. People commonly believe that new version of the system always works slower. I can see this is not the case. Since Windows 7, 8 and now 10 developers put a lot of effort to make it work fast, especially in terms of startup time. I think that Windows 10 boots and works as fast as previous versions.

There are some advantages of the new Windows as well, especially compared to Windows 8.x. There is no Charms Bar and Hot Corners when you but your mouse cursor in the corner of the screen. Start Menu is back with just few tiles you can configure and the old good list of installed applications. (You can always get even more old-fashioned Start Menu by installing free app: Classic Shell).

But the most important is what's not visible to the naked eye. As a developer I know that a new operating system is not about new looks of buttons and menus or new Calc application, but mostly about new technologies under the hood. Some of them (like Direct3D 12 and WDDM 2.0, to name just these related to graphics) are available in Windows 10 only. Some applications and games will require them to work sooner or later. That's the reason I believe it's worth upgrading to Windows 10 as long as it's free.

I plan to update my blog more often now, so I invite you to come back here from time to time or subscribe to my RSS channel.

Comments | #microsoft #windows Share

# DirectX 12: What We Already Know?

Wed
03
Jun 2015

I am very excited about the upcoming DirectX 12. I have always been standing on the side of PC, Windows and DirectX. Currently I code in DirectX 11 on Windows 7 at home. Upcoming Windows 10 with free upgrade from version 7 and 8 (and the Start menu back on its place) looks like a good system. Together with it, a new version of DirectX will be released. Let us summarize general information about this new graphics API that are publicly available at the moment.

Here are some interesting links:

First and foremost: Direct3D 12 Graphics @ msdn.microsoft.com. Microsoft says "these information relate to pre-released product and may be substantially modified before it's commercially released", but you can already find there all Direct3D 12 Programming Guide and Reference, so basically the whole API is already public and you can start learning it.

Social Media:

General information:

Slides and videos from conferences:

Videos and screenshots from some working applications already shown:

Comments | #windows #directx Share

# How to Run Windows Command with Given Working Directory?

Sun
27
May 2012

The concept of "working directory" during program startup or "current directory" of the running process is an interesting topic in itself. Maybe I'll write another time about how to manipulate it in different programming languages. This time enough to say that some programs look for auxilliary files in working directory, some in the directory where own EXE file is located and some in other places like user's profile directory.

Problems begin when a program needs auxilliary files located in same directory as executable, but uses working directory to locate it. Apparently such program expects to always be ran with working directory equal to path of its EXE. It happened to me yesterday while using Windows port of Bison (parser generator). Error was:

win_bison: cannot open file `data/m4sugar/m4sugar.m4': No such file or directory

I can't just run the program with another working directory because I execute it from Visual C++, as a Custom Build Tool associated with my ".y" file. There is only place to enter a command in file property page, no place to change working directory, which is by default the directory of Visual C++ project I think.

The solution I found to be able to run a console command with given parameters and also with given working directory is to do it indirectly, using system "start" command, like this:

start /B /WAIT /D <WorkingDir> <ExePath> <Parameters>

Update 2012-11-29: I was informed that the problem in win_bison is now fixed so it can be used without such workaround.

Comments | #visual studio #windows Share

# jEdit Doesn't Start

Sun
30
Oct 2011

jEdit is a free, multi-platform and my favorite text editor intended for programmers. Some time ago I encountered a problem with it, which repeated again today. So in case you also use this editor or found this post by searching Google, here is the solution:

Problem: jEdit (on Windows) doesn't start. Process is created and exists in memory, but it does nothing and shows no windows, so the only thing you can do is terminating it.

Solution: Terminate the jEdit process and the process of Java virtual machine, then browse to your user directory (like "C:\Users\Adam Sawicki" on my Windows 7) and delete the following small file in a sudirectory: ".jedit\server". After that you will be able to successfully start jEdit.

Comments | #java #tools #windows Share

# Handling Ctrl+C in Windows Console Application

Wed
28
Sep 2011

Just a small code snippet: Let's say you write a console application in native C++ for Windows. Closing the console by pressing Ctrl+C, Ctrl+Break or clicking on close window button [X] kills the process. Is there any way to handle such event and close the program gracefully? The answer is calling SetConsoleCtrlHandler() WinAPI function and implementing your own HandlerRoutine callback function. The template looks like this:

// Handler function will be called on separate thread!
static BOOL WINAPI console_ctrl_handler(DWORD dwCtrlType)
{
  switch (dwCtrlType)
  {
  case CTRL_C_EVENT: // Ctrl+C
    break;
  case CTRL_BREAK_EVENT: // Ctrl+Break
    break;
  case CTRL_CLOSE_EVENT: // Closing the console window
    break;
  case CTRL_LOGOFF_EVENT: // User logs off. Passed only to services!
    break;
  case CTRL_SHUTDOWN_EVENT: // System is shutting down. Passed only to services!
    break;
  }

  // Return TRUE if handled this message, further handler functions won't be called.
  // Return FALSE to pass this message to further handlers until default handler calls ExitProcess().
  return FALSE;
}

int main(int argc, char **argv)
{
  SetConsoleCtrlHandler(console_ctrl_handler, TRUE);
  ...
}

If your program performs some loop and you want the user to be able to break it by closing the console or pressing Ctrl+C, you can solve it this way:

static volatile bool g_exit = false;

static BOOL WINAPI console_ctrl_handler(DWORD dwCtrlType)
{
  g_exit = true;
  return TRUE;
}

int main(int argc, char **argv)
{
  SetConsoleCtrlHandler(console_ctrl_handler, TRUE);
  initialize();
  while (!g_exit)
    do_a_piece_of_work();
  finalize();
}

Comments | #windows #winapi #c++ Share

# Windows 8 Developer Preview

Thu
15
Sep 2011

News about upcoming Windows 8 appear for some time. Information about the new Windows version directly from Microsoft, including technical details for developers, can be found in this PDF: Windows Developer Preview - Windows 8 guide. Recently Microsoft shared a full, development version of this system to download, install and test on your computer for free. It's a developer preview - it contains the new operating system along with new Visual Studio 11. You can download it as ISO image from Windows Developer Preview downloads. The system works in VirtualBox virtual machine. You can see my first gallery of screenshots here:

My first impressions after testing Windows 8 are... quite weird. Apparently they try to make desktop OS looking like a cellphone, with big fonts and all apps working in fullscreen. But that's only a half-truth. I feel that in Microsoft they always do it this way: a boss comes and tells that "we do it again from scratch only better, redefine everything, but we have to preserve backward compatibility", then a developer thinks how to implement it the simplest possible way and it ends in a new flashy UI containing several shortcuts to the most important commands with the old, good windows hiding somewhere under "Advanced" button. It was the same with Control Panel, with formatting functions in MS Office and now it's the same with the whole Desktop. You are presented a new screen full of colourful rectangles, but as soon as you move your cursor to the bottom-left corner of the screen and click "Start", you are teleported to the normal desktop with a wallpaper, taskbar and the Recycle Bin :)

Other things that attracted my attention: You now login to Windows using your Windows Live ID account. System is integrated with Facebook by providing some application to browse it. Explorer now uses the new Ribbon toolbar, just like new versions of MS Office, Paint or WordPad do for some time. There are lots of new games. New Task Manager is great because it now shows four columns with all most important statistics of every running program: the usage of CPU time, RAM memory, disk transfer and network transfer. Finally the new UI style: flat, colourful, minimalistic, full of solid filled rectangles.

Comments | #windows #visual studio #gui Share

# Hotkey for Macro Inserting Text

Wed
03
Aug 2011

I recently code in C - an ancient language with no support for namespaces. To code a bigger system and not create name conflicts, prefixes for all public identifiers must be used. But they not only make the code less readable, but also take lots of time to type. I thought that at least the second issue can be minimized by setting up some macro that would insert predefined text (like "rendering_"), whenever I press a hotkey button (like Pause/Break).

I couldn't find such feature in my Visual C++ 2010 Express, so I decided to look for some general tool for Windows that can trigger a script when a hotkey is pressed. I found AutoHotkey - a free application with its own scripting language that claims to be successor of AutoIt, which I used some time ago. After reading some documentation, I coded following script:

Pause::
SetKeyDelay -1
send rendering_
return

+Pause::
SetKeyDelay -1
send RENDERING_
return

If you have AutoHotkey installed, just save this code to a file, give it "ahk" extension and double-click to run it. Program will create a system tray icon for this script indicating that it's running in the background. From now on you can just press Pause key to insert text "rendering_" to whatever input control you are focused, or Shift+Pause to insert "RENDERING_". It really speeds up coding in C :)

Comments | #windows #tools #c Share

# Pointing to DLL Files in Visual CPP

Tue
12
Apr 2011

When coding in Visual C++, we sometimes need to use some DLL libraries like FMOD, wxWidgets, Intel TBB etc. We download or build the library, setup directories to include and library files, finally #include <header.h>, #pragma comment(lib, "library.lib"), compile, run and...

Certainly our program also needs DLL file at runtime. Sure we have to attach it to the program when we distribute it, but do we really need to copy all these libraries to the Debug and Release subdirectories in our project? For a project run from Visual C++ to find required DLL files, they must be placed either in:

or in the PATH environmental variable. That's an option I've discovered yesterday. To use it in Visual C++, navigate to project properties / Configuration Properties / Debugging / Environment and set it to something like: PATH=$(PATH)$;C:\my_libraries\library_1\DLL_dir

If you do it correctly, your program launched from Visual C++ (with or without debugger - F5 or Ctrl+F5) will now be able to find required DLL libraries without need to copy them to your project directory.

Comments | #windows #c++ #visual studio Share

Pages: > 1 2 3 4 5 ... 7 >

[Download] [Dropbox] [pub] [Mirror] [Privacy policy]
Copyright © 2004-2024